Direct instantiation

Posted by PHPVote 9 years ago

Currently, a variable is needed to instantiate an object from a function such as get_called_class() which returns the name of the class. This variable should be optionnel. ```php class Foo { public static function instantiate() { return new get_called_class()(); //Parse error: syntax error, unexpected '(' } } ```
ArchDemon · 5 years ago

Compolomus · 5 years ago