Re: Re: [RFC] [DISCUSSION]: Closure from callable
| From: | Dan Ackroyd | Date: | Sun, 04 Oct 2015 15:17:50 +0000 |
| Subject: | Re: Re: [RFC] [DISCUSSION]: Closure from callable | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-88665@lists.php.net to get a copy of this message | ||
On 4 October 2015 at 09:54, Andrea Faulds <ajf@ajf.me> wrote:
> If we want to make it avoid duplication,
> okay, then it could be a static method.
Okay, I'll update the RFC to be
Closure::fromCallable() rather than
a function.
I was hoping to have something less verbose than that, but you're
probably right when you say we ought to do that properly with it's own
syntax rather than just a function.
Oh using a static method will rule out being able to alias the
function with the use function syntax.
use function closure as _; //can work
use function Closure::fromCallable as _; //doesn't work
Which is slightly annoying but ¯\_(ツ)_/¯
Additionally, I linked to the wrong branch in the RFC. It should be:
https://github.com/php/php-src/compare/master...Danack:closureSimpler
cheers
Dan