On 04.10.20 22:08, Rowan Tommins wrote:
If we added an opt-in syntax for "capture everything", we might
instead write this:
$f = function() use (*) {
$x = $y = $z = null;
}
Without re-initialising all local variables, we would no longer be
able to know if they were actually local without l
Yes, "use (*)" is perfect!
With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem,
Michael Voříšek
On 5 Oct 2020 11:57, Andreas Leathley wrote:
On 04.10.20 22:08, Rowan Tommins wrote:
If we added an opt-in syntax for "capture everything", we might
instead write this:
$f = fun
On Mon, Oct 5, 2020 at 12:00 PM Michael Voříšek - ČVUT FEL <
voris...@fel.cvut.cz> wrote:
> Yes, "use (*)" is perfect!
>
> With kind regards / Mit freundlichen Grüßen / S přátelským pozdravem,
>
> Michael Voříšek
>
> On 5 Oct 2020 11:57, Andreas Leathley wrote:
>
> > On 04.10.20 22:08, Rowan Tommi
To me that seems like a great argument in favour of the proposal. If you'll
want all variables to be imported (which in this case makes completely
sense), then `fn() {}` or `fn() => {}` is much less verbose and inline with
the mentality to reach for short closures. We reach for short closures to
av
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 onl
On 05.10.20 12:15, Deleu wrote:
To me that seems like a great argument in favour of the proposal. If you'll
want all variables to be imported (which in this case makes completely
sense), then `fn() {}` or `fn() => {}` is much less verbose and inline with
the mentality to reach for short closures.
On 05.10.20 12:24, Andreas Leathley wrote:
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 referenc
>
> Hi Benjamin, hi everyone
I'm wondering if the syntax that allows for several attributes is really
future-proof when considering nested attributes:
*1.*
#[foo]
#[bar]
VS
*2.*
#[foo, bar]
Add nested attributes to the
Hello!
I would like to suggest that static vars must allow expressions too.
Currently it only supports scalar values, but different to consts, it could
be manipulated by its own function that uses that.
https://www.php.net/manual/en/language.variables.scope.php#language.variables.scope.static
Cu
Hi David,
> I would like to suggest that static vars must allow expressions too.
> Currently it only supports scalar values, but different to consts, it could
> be manipulated by its own function that uses that.
This idea was brought up 6 months ago with others in
https://wiki.php.net/rfc/calls_
10 matches
Mail list logo