summaryrefslogtreecommitdiff
path: root/Zend/tests/foreach_016.phpt
blob: 423c8dd0a624771a59594af205fe42eea8a1388c (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)