mirror of
https://github.com/php/php-src.git
synced 2024-09-24 11:27:28 +00:00
16 lines
197 B
Plaintext
16 lines
197 B
Plaintext
|
--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
|