On Thu, Jul 22, 2010 at 5:42 PM, Joel Perras <joel.per...@gmail.com> wrote: > What's confusing about it? Each expression means something very > different and distinct. > > I use $foo(), new $foo(), classname::$foo, classname::$foo(), > $bar::$foo, $bar::$foo(), etc. on a regular basis, and it can make for > some very elegant, concise and readable code.
So you do not consider it utterly confusing that classname::$foo classname::$foo() mean two completely different things? The first reads a property the second reads a local variable. Any time you need to backtrack when you the source code because something you tackled on after changes the meaning of the code completely is considered horribly confusing in my opinion. And then it's utterly nontrivial what new $foo() *should* do. Should it call $foo() and instantiate the class name found in the return value or should instantiate the class found in $foo? If you nuke variable function calls and method calls and replace them with call_user_func() then these go away. Regards NK -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php