diff options
author | Marcus Boerger <helly@php.net> | 2006-12-01 09:29:15 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2006-12-01 09:29:15 +0000 |
commit | 5ea32dc1e4557bb8bc2fb2e1d88ceff4686e90dd (patch) | |
tree | 58b7802ae3c3823f8cd7256ba97196ccca67aa96 /ext/spl/examples | |
parent | 5f3e233ea710d77ec8d28caa2e77fc3cb3728b4a (diff) | |
download | php-git-5ea32dc1e4557bb8bc2fb2e1d88ceff4686e90dd.tar.gz |
- MFH: Fix handling of recursive inner iterators
Diffstat (limited to 'ext/spl/examples')
-rwxr-xr-x | ext/spl/examples/dualiterator.inc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/spl/examples/dualiterator.inc b/ext/spl/examples/dualiterator.inc index 544034856a..3db4487c4a 100755 --- a/ext/spl/examples/dualiterator.inc +++ b/ext/spl/examples/dualiterator.inc @@ -12,7 +12,7 @@ /** @ingroup Examples * @brief Synchronous iteration over two iterators * @author Marcus Boerger - * @version 1.1 + * @version 1.2 */ class DualIterator implements Iterator { @@ -174,6 +174,7 @@ class DualIterator implements Iterator { $it = new RecursiveDualIterator($lhs, $rhs, self::CURRENT_0 | self::KEY_0); + $it = new RecursiveIteratorIterator($it); } else { @@ -187,7 +188,7 @@ class DualIterator implements Iterator if ($identical) { - foreach(new RecursiveIteratorIterator($it) as $n) + foreach($it as $n) { if (!$it->areIdentical()) { |