Re: [RFC] Closure::call and Function Referencing as Closures

From: Date: Tue, 05 Aug 2014 16:01:54 +0000
Subject: Re: [RFC] Closure::call and Function Referencing as Closures
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-76359@lists.php.net to get a copy of this message
At the risk of stating the obvious, can’t you just use $f->bar->__invoke()?
Actually, it was not immediately obvious that __invoke() was a method from the docs as it is a side-note and not in the class signature breakout. Oops! ;) http://php.net/manual/en/class.closure.php That said, call() would be more of a "first-class method" in the Closure class API, as opposed to __invoke() which is largely relegated as a "magic" method. But you have a solid point on that. -ralph

« previous php.internals (#76359) next »