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

16 lines
212 B
PHP

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