mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
- Add new test
This commit is contained in:
parent
dc2d342b24
commit
bb77132391
1 changed files with 44 additions and 0 deletions
44
ext/standard/tests/array/bug29992.phpt
Executable file
44
ext/standard/tests/array/bug29992.phpt
Executable file
|
@ -0,0 +1,44 @@
|
|||
--TEST--
|
||||
Bug #29992 (foreach by reference corrupts the array)
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$array = array(1,2,3);
|
||||
|
||||
print_r($array);
|
||||
|
||||
foreach($array as $item) var_dump($item);
|
||||
foreach($array as &$item) var_dump($item);
|
||||
foreach($array as &$item) var_dump($item);
|
||||
foreach($array as $item) var_dump($item);
|
||||
|
||||
print_r($array);
|
||||
|
||||
?>
|
||||
===DONE===
|
||||
--EXPECT--
|
||||
Array
|
||||
(
|
||||
[0] => 1
|
||||
[1] => 2
|
||||
[2] => 3
|
||||
)
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
int(1)
|
||||
int(2)
|
||||
int(3)
|
||||
Array
|
||||
(
|
||||
[0] => 1
|
||||
[1] => 2
|
||||
[2] => 3
|
||||
)
|
||||
===DONE===
|
Loading…
Add table
Add a link
Reference in a new issue