Mike Schinkel wrote:

> I had asked Ben what he thought about allowing the following syntax as a 
> synonym for `new Foo()`:
>
> Foo::new()

This can already be done in application code, having the language add a synonym 
is IMO unnecessary magic and breaks the
principle of the least surprise.

The solution proposed in https://bugs.php.net/bug.php?id=70549 however is very 
similar to what I'm asking.
Note that in that bug entry the solution was based on the premise that `$obj = 
new $foo->bar();` was valid code, which
it isn't. (https://3v4l.org/lpN1T)

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to