Den 2016-04-07 kl. 21:11, skrev Markus Fischer:
Hey,

On 07.04.2016 14:21, Andrea Faulds wrote:
Bob and I have made an RFC which proposes an alternative syntax for list():

https://wiki.php.net/rfc/short_list_syntax

Please tell us your thoughts.
Reading the last sample in the RFC:

  Both due to implementation issues, and for consistency's sake, list()
cannot be nested inside [], nor vice-versa:
[...]
// This, however, is allowed:
[[$a, $b], [$c, $d]] = [[1, 2], [3, 4]];
I read it as it's the combination that is not allowed, but nesting
list itself works. So adding following to RFC might be enough:
"...
// This, however, is allowed:
[[$a, $b], [$c, $d]] = [[1, 2], [3, 4]];
// In a similar  fashion like
list(list($a, $b), list($c, $d)) = [[1, 2], [3, 4]];"

Anyway, nice and well written RFC, +1!

Regards //Björn


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to