Re: RFC: Support for multi-line arrow functions

From: Date: Mon, 05 Oct 2020 10:24:44 +0000
Subject: Re: RFC: Support for multi-line arrow functions
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-112004@lists.php.net to get a copy of this message
On 05.10.20 12:08, Lynn wrote:
How should php deal with the scenario where you want to use everything and have one variable by reference?
function () use (*, &$butNotThisOne) {};
The easiest would be to only allow "use (*)" with no references or additional syntax. "use (*)" would only copy all local variables into the closure, no references. Personally I have never used references with "use", I think it is much more niche compared to the regular copying, and there is still the explicit (current) syntax to do references.

« previous php.internals (#112004) next »