summaryrefslogtreecommitdiff
path: root/Zend/tests/list_keyed_evaluation_order_3.phpt
blob: 7850834c3b2b086d29195fed1f1e9640480912cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
list() with keys, evaluation order #3
--FILE--
<?php

$i = 0;
$a = [
    0 => [
        'b' => 'bar',
        'a' => 'foo',
    ],
    1 => 'a',
    3 => 'b',
];
list($a[$i++] => $a[$i++], $a[$i++] => $a[$i++]) = $a[$i++];
var_dump($i); // should be 5
var_dump($a[2]); // should be 'foo'
var_dump($a[4]); // should be 'bar'

?>
--EXPECT--
int(5)
string(3) "foo"
string(3) "bar"