From c4dd7a1a684490673e25aaf4fabec5df138854c4 Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Thu, 14 Mar 2013 05:42:27 +0000 Subject: Imported from /home/lorry/working-area/delta_php2/php-5.4.13.tar.bz2. --- ext/spl/examples/recursivedualiterator.inc | 72 ++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 ext/spl/examples/recursivedualiterator.inc (limited to 'ext/spl/examples/recursivedualiterator.inc') diff --git a/ext/spl/examples/recursivedualiterator.inc b/ext/spl/examples/recursivedualiterator.inc new file mode 100644 index 0000000..cfa3bcc --- /dev/null +++ b/ext/spl/examples/recursivedualiterator.inc @@ -0,0 +1,72 @@ +getLHS()->hasChildren() && $this->getRHS()->hasChildren(); + } + + /** @return new RecursiveDualIterator (late binding) for the two inner + * iterators current children. + */ + function getChildren() + { + if (empty($this->ref)) + { + $this->ref = new ReflectionClass($this); + } + return $this->ref->newInstance( + $this->getLHS()->getChildren(), $this->getRHS()->getChildren(), $this->getFlags()); + } + + /** @return whether both inner iterators are valid, have same hasChildren() + * state and identical current and key values or both are non valid. + */ + function areIdentical() + { + return $this->getLHS()->hasChildren() === $this->getRHS()->hasChildren() + && parent::areIdentical(); + } + + /** @return whether both inner iterators are valid, have same hasChildren() + * state and equal current and key values or both are invalid. + */ + function areEqual() + { + return $this->getLHS()->hasChildren() === $this->getRHS()->hasChildren() + && parent::areEqual(); + } +} + +?> -- cgit v1.2.1