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

From: Date: Tue, 05 Aug 2014 16:40:34 +0000
Subject: Re: [RFC] Closure::call and Function Referencing as Closures
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-76361@lists.php.net to get a copy of this message
On 5 Aug 2014, at 17:08, Marco Pivetta <ocramius@gmail.com> wrote: > > On 5 August 2014 18:01, Ralph Schindler <ralph@ralphschindler.com> wrote: > 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 > > Interestingly, reflection doesn't even expose it: > http://3v4l.org/8Jutn Side note, but that’s because __invoke on Closure doesn’t actually exist. It’s a method that is created by trying to access it and ceases to exist once called. Freaky, right? -- Andrea Faulds http://ajf.me/

« previous php.internals (#76361) next »