Browse Source

- Make recursive part and identical part work correct

migration/RELEASE_1_0_0
Marcus Boerger 20 years ago
parent
commit
0638b7cfec
  1. 2
      ext/spl/examples/recursivedualiterator.inc
  2. 8
      ext/spl/examples/tests/dualiterator_001.phpt

2
ext/spl/examples/recursivedualiterator.inc

@ -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()

8
ext/spl/examples/tests/dualiterator_001.phpt

@ -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===
Loading…
Cancel
Save