Re: Could we kill call_user_func?
| From: | Steve Clay | Date: | Thu, 21 Mar 2013 13:16:16 +0000 |
| Subject: | Re: Could we kill call_user_func? | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-66736@lists.php.net to get a copy of this message | ||
On 3/21/13 7:37 AM, Derick Rethans wrote:
On Fri, 15 Mar 2013, Steve Clay wrote:I was not clear in my initial post. I don't want call_user_func removed, just made unnecessary. To reiterate why: 1. call_user_func fails reference args. (It's not a full substitute for a direct call) 2. Most callable values are already directly callable: ✓ func as string ✓ dynamic method as array ✓ static method as arraycall_user_func() just seems so ugly now that we have nicer syntax in so many other areas.That doesn't mean we should just be ripping out functionality that works perfectly fine.
static method as string✓ Closure ✓ object with __invoke
Closure in object property (I understand why this is off the table)
expression containing Closure in object property
If always store the callable in a var, the situation is much better:
✓ func as string
✓ dynamic method as array
✓ static method as array
static method as string✓ Closure ✓ object with __invoke ✓ Closure in object property How difficult would it be to support making this work? $c = "Foo::bar"; $c(); Steve Clay -- http://www.mrclay.org/