From 849fb0720173952874af8214da6f01a3e73875d0 Mon Sep 17 00:00:00 2001 From: Marcus Boerger Date: Thu, 15 Sep 2005 03:48:38 +0000 Subject: [PATCH] - MFB --- ext/spl/examples/recursivearrayiterator.inc | 55 +++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100755 ext/spl/examples/recursivearrayiterator.inc 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 -- 2.50.1