Re: Remove variable function and method calls
| From: | Davey Shafik | Date: | Thu, 22 Jul 2010 23:51:10 +0000 |
| Subject: | Re: Remove variable function and method calls | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-49113@lists.php.net to get a copy of this message | ||
You can call classname::$foo() and even $obj->$foo() with call_user_func(), should we get rid of
those too?
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).
- Davey
On Jul 22, 2010, at 6:54 PM, Karoly Negyesi <karoly@negyesi.net> wrote:
> Hi,
>
> Given that call_user_func exists I would recommend to remove $foo()
> from PHP Next.
>
> Observe the "logic" in the following examples:
>
> $foo();
> new $foo();
> classname::$foo;
> classname::$foo();
>
> There is a word for this and that word is madness.
>
> The simplest is to nuke $foo(). call_user_func() is a perfect replacement.
>
> Regards
>
> Karoly Negyesi
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>