mirror of
https://github.com/danog/PHP-Parser.git
synced 2024-12-11 17:09:41 +01:00
437890d386
Potentially the pretty printer should force use of [] in assignment context, instead of relying on the existance of the right attribute.
14 lines
246 B
Plaintext
14 lines
246 B
Plaintext
Array destructuring
|
|
-----
|
|
<?php
|
|
|
|
[$a, $b] = [$c, $d];
|
|
[, $a, , , $b, ,] = $foo;
|
|
[, [[$a]], $b] = $bar;
|
|
['a' => $b, 'b' => $a] = $baz;
|
|
-----
|
|
!!php7
|
|
[$a, $b] = [$c, $d];
|
|
[, $a, , , $b, ] = $foo;
|
|
[, [[$a]], $b] = $bar;
|
|
['a' => $b, 'b' => $a] = $baz; |