Re: [RFC] Alternative "use" syntax for Closures

From: Date: Sun, 16 Jun 2019 12:04:35 +0000
Subject: Re: [RFC] Alternative "use" syntax for Closures
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-105950@lists.php.net to get a copy of this message
On 15/06/2019 22:53, Wes wrote:
Hello PHP, I just published https://wiki.php.net/rfc/alternative-closure-use-syntax I would love your opinion on this
I'm not overly fond of it myself because I think it could make it slightly more difficult to parse in my brain. If there was a: $x = 0; $y = 1; $closure = function() use (...) { }; Where "use (...)" would auto-capture all of the used variables in a similar manner to short closures, that would certainly save a bit of time. -- Mark Randall

« previous php.internals (#105950) next »