On 4 Aug 2014, at 01:53, Thomas Bley <[email protected]> wrote:
> from userland perspective, I would prefer to open the Closure constructor
> instead of adding new syntax:
>
> $qux = new FooBar(3);
> // $func = &FooBar::getStatic;
> $func = new Closure(array('FooBar', 'getStatic'));
> $func($qux); // 3
You can actually do that already in a convoluted way:
$func = (new ReflectionMethod(“FooBar::getStatic”)->getClosure());
Though it must be explicitly bound in the case of a non-static method.
--
Andrea Faulds
http://ajf.me/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php