On Thursday 19 March 2015 18:17:50 S.A.N wrote:
> > Then how would you write an callback containing an already constructed
> > object? $a = [$object, 'method'];
> > 
> > The alternative is unnecessarily cumbersome:
> > $a = function($methodArg1, $methodArg2) use($object) { return
> > $object->method($methodArg1, $methodArg2); };
> 
> $object->$methodName(...$args);

That's a call. Requested was an assignment. You cannot assign that and pass it 
around for later calling. You cannot pass that as a callable parameter.

Patrick

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

Reply via email to