Re: [RFC] Short syntax for anonymous functions
| From: | Levi Morrison | Date: | Tue, 19 Feb 2013 17:19:15 +0000 |
| Subject: | Re: [RFC] Short syntax for anonymous functions | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-65971@lists.php.net to get a copy of this message | ||
> Have you considered how this will work/look in an array?
>
> $a = [$b => ($n) $m => $m * $n]; // wat.
First off, it should be:
$a = [$b => ($n) |$m| => $m * $n];
The || make a big difference in this situation.
Secondly, if you hit a situation where the syntax is confusing, use a
less confusing syntax if possible. This goes for any type of syntactic
confusion, not just short-array syntax.