diff options
| author | Marcus Boerger <helly@php.net> | 2004-10-04 17:53:55 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2004-10-04 17:53:55 +0000 |
| commit | bb77132391aaeb07daa0e057ea5c11cdb151dfda (patch) | |
| tree | a714c430bcce8fc2bb36f33284995d0e3e1ff562 | |
| parent | dc2d342b24e74867c561d31c9d85c3d09a458366 (diff) | |
| download | php-git-bb77132391aaeb07daa0e057ea5c11cdb151dfda.tar.gz | |
- Add new test
| -rwxr-xr-x | ext/standard/tests/array/bug29992.phpt | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/ext/standard/tests/array/bug29992.phpt b/ext/standard/tests/array/bug29992.phpt new file mode 100755 index 0000000000..74be291891 --- /dev/null +++ b/ext/standard/tests/array/bug29992.phpt @@ -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=== |
