2010/7/23 Karoly Negyesi <kar...@negyesi.net>: > 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. >
I do not see whats wrong with the variable function call syntax at all, most other languages like JS have similar concepts, even C. But unlike those, PHP does not use function pointers and is loosely typed so there is "no" distinct callback type. Variable function calls are very handy for various tasks that have a really dynamic internal API, removing it from the language is a huge BC break, along with all the other statements in this threads. So no its not going to be removed. -- regards, Kalle Sommer Nielsen ka...@php.net -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php