Calling PHP Parent Constructors With Old/New Syntax

后端 未结 2 934
孤独总比滥情好
孤独总比滥情好 2021-01-04 09:40

Given the class Foo with an old-style constructor

class Foo
{
    public function Foo()
    {
        //does constructing stuff
    }
}

Is

2条回答
  •  一生所求
    2021-01-04 10:14

    As of PHP 5.3.3 the old style ctor will not work when you are using namespaces.

    See http://www.php.net/archive/2010.php#id2010-07-22-2

提交回复
热议问题