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