SPL-StandardPHPLibrary
recursivedualiterator.inc
Go to the documentation of this file.
1 <?php
2 
18 {
19  private $ref;
20 
28  $flags = 0x33 /*DualIterator::DEFAULT_FLAGS*/)
29  {
30  parent::__construct($lhs, $rhs, $flags);
31  }
32 
35  function hasChildren()
36  {
37  return $this->getLHS()->hasChildren() && $this->getRHS()->hasChildren();
38  }
39 
43  function getChildren()
44  {
45  if (empty($this->ref))
46  {
47  $this->ref = new ReflectionClass($this);
48  }
49  return $this->ref->newInstance(
50  $this->getLHS()->getChildren(), $this->getRHS()->getChildren(), $this->getFlags());
51  }
52 
56  function areIdentical()
57  {
58  return $this->getLHS()->hasChildren() === $this->getRHS()->hasChildren()
59  && parent::areIdentical();
60  }
61 
65  function areEqual()
66  {
67  return $this->getLHS()->hasChildren() === $this->getRHS()->hasChildren()
68  && parent::areEqual();
69  }
70 }
71 
72 ?>
__construct(RecursiveIterator $lhs, RecursiveIterator $rhs, $flags=0x33)
construct iterator from two RecursiveIterator instances
Interface for recursive iteration with RecursiveIteratorIterator.
Synchronous iteration over two recursive iterators.
Synchronous iteration over two iterators.