Re: [RFC] Closure::call and Function Referencing as Closures
| From: | Marco Pivetta | Date: | Tue, 05 Aug 2014 15:53:48 +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-76358@lists.php.net to get a copy of this message | ||
On 5 August 2014 17:50, Andrea Faulds <ajf@ajf.me> wrote:
>
> On 5 Aug 2014, at 16:20, Ralph Schindler <ralph@ralphschindler.com> wrote:
>
> > "->call()" would facilitate the following syntax, which I'd argue has
> greater semantic meaning than the call_user_func() variant:
> >
> > $f->bar->call()->call();
>
> At the risk of stating the obvious, can’t you just use $f->bar->__invoke()
You can't do that if you can't assume that
bar is a Closure
instance.
Marco Pivetta
http://twitter.com/Ocramius
http://ocramius.github.com/