On 3/21/13 7:37 AM, Derick Rethans wrote:
On Fri, 15 Mar 2013, Steve Clay wrote:

call_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.

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 array
     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/

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to