Re: [RFC] Arrow functions / short closures
| From: | David Rodrigues | Date: | Thu, 14 Mar 2019 15:38:28 +0000 |
| Subject: | Re: [RFC] Arrow functions / short closures | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-104717@lists.php.net to get a copy of this message | ||
Em qui, 14 de mar de 2019 às 03:17, Rowan Collins <rowan.collins@gmail..com>
escreveu:
> I don't think this helps, because you can put brackets around any
> expression, for precedence, and any expression can appear on the left of an
> array literal:
>
> $foo = [ ($bar + 1) * 2 => $baz ];
>
> So the following, while redundant, is currently valid:
>
> $foo = [ ($bar) => $baz ];
>
Yeah, I don't think in that case. And maybe using [] instead of ()? For
instance: "[$x] => $x + 1". PHP don't supports and array as key, so maybe
it will not causes any conflict.
--
David Rodrigues