[RFC] Auto-capture multi-line closures and short functions take 2
| From: | Larry Garfield | Date: | Wed, 24 Mar 2021 16:19:58 +0000 |
| Subject: | [RFC] Auto-capture multi-line closures and short functions take 2 | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-113740@lists.php.net to get a copy of this message | ||
Greetings, Internalians.
Some months back I proposed an RFC for short functions.
https://wiki.php.net/rfc/short-functions
After some discussion, I put it on hold to ensure that it was compatible with the other discussion
floating about around an alternate syntax for multi-line closures that did auto-capture. It's
important that the syntax of both proposals is consistent.
Nuno Maduro and i have talked recently and worked out the syntax that is consistent between both
proposals. That takes 'fn' off the table for short-functions, for reasons discussed in
both RFCs.
To that end, I offer:
1) The updated short-functions RFC: https://wiki.php.net/rfc/short-functions
2) A new RFC, code by Nuno, for auto-capturing multi-statement closures: https://wiki.php.net/rfc/auto-capture-closure
These are separate RFCs and at this time we plan to send them to separate votes, but I list them
together to demonstrate that they have been developed in a mutually-compatible way.
Further details in the auto-capture-closure RFC.
--
Larry Garfield
larry@garfieldtech.com