mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-12-12 17:17:31 +01:00
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;
|