1
0
mirror of https://github.com/danog/PHP-Parser.git synced 2024-12-03 17:57:59 +01:00
PHP-Parser/test/code/parser/expr/listWithKeys.test

84 lines
2.5 KiB
Plaintext
Raw Normal View History

List destructing with keys
-----
<?php
list('a' => $b) = ['a' => 'b'];
list('a' => list($b => $c), 'd' => $e) = $x;
-----
!!php7
array(
2017-01-19 22:25:22 +01:00
0: Stmt_Expression(
expr: Expr_Assign(
var: Expr_List(
items: array(
0: Expr_ArrayItem(
key: Scalar_String(
value: a
)
value: Expr_Variable(
name: b
)
byRef: false
2019-05-09 15:11:00 +02:00
unpack: false
)
)
)
2017-01-19 22:25:22 +01:00
expr: Expr_Array(
items: array(
0: Expr_ArrayItem(
key: Scalar_String(
value: a
)
value: Scalar_String(
value: b
)
byRef: false
2019-05-09 15:11:00 +02:00
unpack: false
)
)
)
)
)
2017-01-19 22:25:22 +01:00
1: Stmt_Expression(
expr: Expr_Assign(
var: Expr_List(
items: array(
0: Expr_ArrayItem(
key: Scalar_String(
value: a
)
value: Expr_List(
items: array(
0: Expr_ArrayItem(
key: Expr_Variable(
name: b
)
value: Expr_Variable(
name: c
)
byRef: false
2019-05-09 15:11:00 +02:00
unpack: false
)
)
)
2017-01-19 22:25:22 +01:00
byRef: false
2019-05-09 15:11:00 +02:00
unpack: false
)
2017-01-19 22:25:22 +01:00
1: Expr_ArrayItem(
key: Scalar_String(
value: d
)
value: Expr_Variable(
name: e
)
byRef: false
2019-05-09 15:11:00 +02:00
unpack: false
)
)
)
2017-01-19 22:25:22 +01:00
expr: Expr_Variable(
name: x
)
)
)
)