From: Marcus Boerger Date: Thu, 15 Sep 2005 03:48:38 +0000 (+0000) Subject: - MFB X-Git-Tag: RELEASE_0_9_0~211 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=849fb0720173952874af8214da6f01a3e73875d0;p=php - MFB --- diff --git a/ext/spl/examples/recursivearrayiterator.inc b/ext/spl/examples/recursivearrayiterator.inc new file mode 100755 index 0000000000..305e54cad9 --- /dev/null +++ b/ext/spl/examples/recursivearrayiterator.inc @@ -0,0 +1,55 @@ +current()); + } + + /** @return an iterator for the current elements children + * + * @note the returned iterator will be of the same class as $this + */ + function getChildren() + { + if (empty($this->ref)) + { + $this->ref = new ReflectionClass($this); + } + return $this->ref->newInstance($this->current()); + } + + private $ref; +} + +?> \ No newline at end of file