Re: Remove variable function and method calls

From: Date: Fri, 23 Jul 2010 00:42:25 +0000
Subject: Re: Remove variable function and method calls
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-49115@lists.php.net to get a copy of this message
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. Moreover, this really isn't something you can just remove from the language. There's already a fair bit of code (including my own) out in the wild that makes use of this syntax. -j. On Thu, Jul 22, 2010 at 8:29 PM, Karoly Negyesi <karoly@negyesi.net> wrote: > On Thu, Jul 22, 2010 at 4:51 PM, Davey Shafik <davey@php.net> wrote: >> You can call classname::$foo() and even $obj->$foo() with call_user_func(), should we >> get rid of those too? > > Absolutely not. > >> I grant you that variable function calls are sometimes confusing, lambda functions are a >> better way to do it perhaps, but just because something can be abused, doesn't mean it should >> be removed, unless it's impeding further innovation (a la namespaced old style constructors). > > It's not abusing it's the horribly confusing syntax. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- I do know everything, just not all at once. It's a virtual memory problem. You should follow me on Twitter: http://twitter.com/jperras

« previous php.internals (#49115) next »