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

From: Date: Sun, 16 Jun 2019 05:46:47 +0000
Subject: Re: [RFC] Alternative "use" syntax for Closures
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-105949@lists.php.net to get a copy of this message
Hi, If at some point we would have multi-statement body arrow function, I would assume that one option would be to have the closure done automatically, as it is done now on the one-line arrow function. If the values will not be implicitly captured, maybe a new syntax to capture can be designed there, for multi-line arrow functions. A way to scan variables is already implemented for the one-line and, I guess, a way to scan for few lines could also be implemented easier for the new syntax. Alex On Sun, Jun 16, 2019, 00:54 Wes <netmo.php@gmail.com> wrote: > Hello PHP, I just published > > https://wiki.php.net/rfc/alternative-closure-use-syntax > > I would love your opinion on this > > I know it seems overkill and wrong to have two different syntaxes for the > same thing, but I really believe that's all we need to fix one of the most > hated PHP syntax bits. > > Thank you. > > Wes >

« previous php.internals (#105949) next »