]> granicus.if.org Git - php/commitdiff
- Make recursive part and identical part work correct
authorMarcus Boerger <helly@php.net>
Thu, 25 May 2006 18:15:04 +0000 (18:15 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 25 May 2006 18:15:04 +0000 (18:15 +0000)
ext/spl/examples/recursivedualiterator.inc
ext/spl/examples/tests/dualiterator_001.phpt

index 7b5f85b9f9a610983f0e15b446041321a581717d..702e0cd745411414188d114e1a6cd37bc49aafbe 100755 (executable)
@@ -47,7 +47,7 @@ class RecursiveDualIterator extends DualIterator implements RecursiveIterator
                        $this->ref = new ReflectionClass($this);
                }
                return $this->ref->newInstance(
-                                       $this->getLHS()->current(), $this->getRHS()->current(), $this->flags);
+                                       $this->getLHS()->getChildren(), $this->getRHS()->getChildren(), $this->getFlags());
        }
 
        /** @return whether both inner iterators are valid, have same hasChildren()
index e69a39b00c9da3cc9a0c5631823de4b6e88eeaae..5577c4dc180581d5696636e585694187c70d2768 100755 (executable)
@@ -26,6 +26,10 @@ test(array(1,array(21,22),3), array(1,array(21,22),3));
 test(array(1,array(21,22),3), array(1,array(21,22,23),3));
 test(array(1,array(21,22),3), array(1,array(21,22,3)));
 test(array(1,array(21,22),3), array(1,array(21),array(22),3));
+test(array(1,2,3), array(1,"2",3), false);
+test(array(1,2,3), array(1,"2",3), true);
+test(array(1,array(21,22),3), array(1,array(21,"22"),3), false);
+test(array(1,array(21,22),3), array(1,array(21,"22"),3), true);
 
 ?>
 ===DONE===
@@ -36,4 +40,8 @@ bool(true)
 bool(false)
 bool(false)
 bool(false)
+bool(true)
+bool(false)
+bool(true)
+bool(false)
 ===DONE===