]> granicus.if.org Git - php/commitdiff
This commit was manufactured by cvs2svn to create branch 'PHP_4_3'.
authorSVN Migration <svn@php.net>
Tue, 30 Mar 2004 19:08:44 +0000 (19:08 +0000)
committerSVN Migration <svn@php.net>
Tue, 30 Mar 2004 19:08:44 +0000 (19:08 +0000)
ext/standard/tests/array/bug27782.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/array/bug27782.phpt b/ext/standard/tests/array/bug27782.phpt
new file mode 100644 (file)
index 0000000..2c8c675
--- /dev/null
@@ -0,0 +1,32 @@
+--TEST--
+Bug #27782 (each(), next(), prev() mange array position)
+--FILE--
+<?php
+$a = array("a", "b", "c");
+reset($a);
+
+while (next($a) !== false);
+
+echo current($a) . "\n";
+echo prev($a) . "\n";
+
+reset($a);
+
+while (list(,$foo) = each($a)) {
+       echo $foo . "\n";
+}
+echo current($a) . "\n";
+
+while ($foo = prev($a)) {
+       echo $foo . "\n";
+}
+?>
+--EXPECT--
+c
+b
+a
+b
+c
+c
+b
+a