summaryrefslogtreecommitdiff
path: root/Zend/tests/foreach_016.phpt
blob: 461c5b2431b4533da0e0ddb7390484d97b788138 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--TEST--
array_unshift() function precerve foreach by reference iterator pointer
--FILE--
<?php
$a = [1,2,3];
foreach($a as &$v) {
    echo "$v\n";
    if ($v == 2) {
        array_unshift($a, 0, 0, 0, 0, 0, 0, 0, 0);
    }
}
var_dump(count($a));
?>
--EXPECT--
1
2
3
int(11)