php-src/Zend/tests/foreach_011.phpt
2020-02-03 22:52:20 +01:00

20 lines
218 B
PHP

--TEST--
sort() functions precerve foreach by reference iterator pointer
--FILE--
<?php
$a = [1,2,3,4,5,0];
foreach($a as &$v) {
echo "$v\n";
if ($v == 3) {
rsort($a);
}
}
?>
--EXPECT--
1
2
3
2
1
0