1--TEST--
2By-reference array destructuring (PHP 7.3)
3--SKIPIF--
4<?php if (PHP_VERSION_ID < 70300) die('skip PHP >= 7.3 only'); ?>
5--FILE--
6<?php
7
8require __DIR__ . '/../util.php';
9
10$code = <<<'PHP'
11<?php
12list($a, &$b) = $c;
13[$a, &$b] = $c;
14$c = [$a, &$b];
15PHP;
16echo ast_dump(ast\parse_code($code, $version=70)), "\n";
17
18?>
19--EXPECT--
20AST_STMT_LIST
21    0: AST_ASSIGN
22        var: AST_ARRAY
23            flags: ARRAY_SYNTAX_LIST (1)
24            0: AST_ARRAY_ELEM
25                flags: 0
26                value: AST_VAR
27                    name: "a"
28                key: null
29            1: AST_ARRAY_ELEM
30                flags: ARRAY_ELEM_REF (1)
31                value: AST_VAR
32                    name: "b"
33                key: null
34        expr: AST_VAR
35            name: "c"
36    1: AST_ASSIGN
37        var: AST_ARRAY
38            flags: ARRAY_SYNTAX_SHORT (3)
39            0: AST_ARRAY_ELEM
40                flags: 0
41                value: AST_VAR
42                    name: "a"
43                key: null
44            1: AST_ARRAY_ELEM
45                flags: ARRAY_ELEM_REF (1)
46                value: AST_VAR
47                    name: "b"
48                key: null
49        expr: AST_VAR
50            name: "c"
51    2: AST_ASSIGN
52        var: AST_VAR
53            name: "c"
54        expr: AST_ARRAY
55            flags: ARRAY_SYNTAX_SHORT (3)
56            0: AST_ARRAY_ELEM
57                flags: 0
58                value: AST_VAR
59                    name: "a"
60                key: null
61            1: AST_ARRAY_ELEM
62                flags: ARRAY_ELEM_REF (1)
63                value: AST_VAR
64                    name: "b"
65                key: null