mirror of
https://github.com/php/php-src.git
synced 2024-12-20 07:20:33 +08:00
16 lines
212 B
PHP
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
|