xref: /php-src/Zend/tests/gh11320_1.phpt (revision 8ed66b43)
1--TEST--
2GH-11320: Array literals can contain list() assignments
3--FILE--
4<?php
5$index = 1;
6function getList() { return [2, 3]; }
7var_dump([$index => list($x, $y) = getList()]);
8var_dump([$index => [$x, $y] = getList()]);
9?>
10--EXPECT--
11array(1) {
12  [1]=>
13  array(2) {
14    [0]=>
15    int(2)
16    [1]=>
17    int(3)
18  }
19}
20array(1) {
21  [1]=>
22  array(2) {
23    [0]=>
24    int(2)
25    [1]=>
26    int(3)
27  }
28}
29