Re: [RFC] Square bracket syntax for array destructuring assignment

From: Date: Thu, 07 Apr 2016 20:17:33 +0000
Subject: Re: [RFC] Square bracket syntax for array destructuring assignment
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-92149@lists.php.net to get a copy of this message
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

« previous php.internals (#92149) next »