1--TEST--
2Evaluation order during assignments.
3--FILE--
4<?php
5
6function i1() {
7        echo "i1\n";
8        return 1;
9}
10
11function i2() {
12        echo "i2\n";
13        return 1;
14}
15
16function i3() {
17        echo "i3\n";
18        return 3;
19}
20
21function i4() {
22        global $a;
23        $a = array(10, 11, 12, 13, 14);
24        echo "i4\n";
25        return 4;
26}
27
28$a = 0; // $a should not be indexable till the i4 has been executed
29list($a[i1()+i2()], , list($a[i3()], $a[i4()]), $a[]) = array (0, 1, array(30, 40), 3, 4);
30
31var_dump($a);
32
33?>
34--EXPECT--
35i1
36i2
37i3
38i4
39array(6) {
40  [0]=>
41  int(10)
42  [1]=>
43  int(11)
44  [2]=>
45  int(0)
46  [3]=>
47  int(30)
48  [4]=>
49  int(40)
50  [5]=>
51  int(3)
52}
53