Re: [RFC] [Discussion] Short Closures
| From: | Dan Cryer | Date: | Thu, 03 Sep 2015 10:40:07 +0000 |
| Subject: | Re: [RFC] [Discussion] Short Closures | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-88029@lists.php.net to get a copy of this message | ||
>
> I had this RFC in draft since some time, but delayed it due to all the
> ongoing PHP 7 discussions. Also we have no master branch to merge features
> in until 5.4 EOL. Thus I'm reviving this now.
>
> Time for the first RFC targeting PHP 7.1 (assuming PHP 8 isn't going to be
> the next version ;-)):
>
> The short Closures RFC:
> https://wiki.php.net/rfc/short_closures
>
> Hoping for constructive feedback,
> Bob
>
As a PHP developer (not an internals developer) - I love this proposal!
Out of interest, is there a technical reason you couldn't use an existing
token, such as => for this? If you could, it'd be almost identical to the
syntax used in C#:
*ThingList.Where(x => x > 7)*
*PersonList.Where(p => (p.Gender == "M" && p.Age < 30))*
Dan