]> granicus.if.org Git - php/commitdiff
Added while(list() = each()) test
authorYasuo Ohgaki <yohgaki@php.net>
Sat, 23 Mar 2002 01:34:50 +0000 (01:34 +0000)
committerYasuo Ohgaki <yohgaki@php.net>
Sat, 23 Mar 2002 01:34:50 +0000 (01:34 +0000)
# We may want tests/bugs ?

tests/lang/031.phpt [new file with mode: 0644]

diff --git a/tests/lang/031.phpt b/tests/lang/031.phpt
new file mode 100644 (file)
index 0000000..7a88cb6
--- /dev/null
@@ -0,0 +1,23 @@
+--TEST--
+Nested while(list() = each()). (Bug #16227)
+--POST--
+--GET--
+--FILE--
+<?php
+// reported by php.net@alienbill.com
+       $outsidearray = array("key1","key2");
+       $insidearray = array("0","1");
+
+           while(list(,$outerval) = each($outsidearray)){
+               //$placeholder = $insidearray;
+               while(list(,$innerval) = each($insidearray)){
+                       print "inloop $innerval for $outerval\n";
+               }
+       }
+?>
+--EXPECT--
+inloop 0 for key1
+inloop 1 for key1
+inloop 0 for key2
+inloop 1 for key2
+