1--TEST--
2"Reference Unpacking - General" list()
3--FILE--
4<?php
5$arr = array(1, array(2));
6list(&$a, list(&$b)) = $arr;
7var_dump($a, $b);
8var_dump($arr);
9
10$arr = array(1, array(2));
11list($a, &$b) = $arr;
12var_dump($arr);
13
14$arr = array(1, array(2));
15[&$a, [&$b]] = $arr;
16var_dump($a, $b);
17var_dump($arr);
18
19$arr = array(1, array(2));
20[&$a, [&$b], &$c] = $arr;
21var_dump($a, $b, $c);
22var_dump($arr);
23
24$arr = array("one" => 1, "two" => array(2));
25["one" => &$a, "two" => [&$b], "three" => &$c] = $arr;
26var_dump($a, $b, $c);
27var_dump($arr);
28?>
29--EXPECT--
30int(1)
31int(2)
32array(2) {
33  [0]=>
34  &int(1)
35  [1]=>
36  array(1) {
37    [0]=>
38    &int(2)
39  }
40}
41array(2) {
42  [0]=>
43  int(1)
44  [1]=>
45  &array(1) {
46    [0]=>
47    int(2)
48  }
49}
50int(1)
51int(2)
52array(2) {
53  [0]=>
54  &int(1)
55  [1]=>
56  array(1) {
57    [0]=>
58    &int(2)
59  }
60}
61int(1)
62int(2)
63NULL
64array(3) {
65  [0]=>
66  &int(1)
67  [1]=>
68  array(1) {
69    [0]=>
70    &int(2)
71  }
72  [2]=>
73  &NULL
74}
75int(1)
76int(2)
77NULL
78array(3) {
79  ["one"]=>
80  &int(1)
81  ["two"]=>
82  array(1) {
83    [0]=>
84    &int(2)
85  }
86  ["three"]=>
87  &NULL
88}
89