mirror of
https://github.com/php/php-src.git
synced 2024-12-03 23:05:57 +08:00
19 lines
220 B
PHP
19 lines
220 B
PHP
--TEST--
|
|
array_shift() function precerve foreach by reference iterator pointer
|
|
--FILE--
|
|
<?php
|
|
$a = [1,2,3,4];
|
|
foreach($a as &$v) {
|
|
echo "$v\n";
|
|
array_shift($a);
|
|
}
|
|
var_dump($a);
|
|
?>
|
|
--EXPECT--
|
|
1
|
|
2
|
|
3
|
|
4
|
|
array(0) {
|
|
}
|