mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
18 lines
206 B
Plaintext
18 lines
206 B
Plaintext
|
--TEST--
|
||
|
array_push() function precerve foreach by reference iterator pointer
|
||
|
--FILE--
|
||
|
<?php
|
||
|
$a = [1,2,3];
|
||
|
foreach($a as &$v) {
|
||
|
echo "$v\n";
|
||
|
if ($v == 3) {
|
||
|
array_push($a, 4);
|
||
|
}
|
||
|
}
|
||
|
?>
|
||
|
--EXPECT--
|
||
|
1
|
||
|
2
|
||
|
3
|
||
|
4
|