Skip to content

Commit 5ea32dc

Browse files
committed
- MFH: Fix handling of recursive inner iterators
1 parent 5f3e233 commit 5ea32dc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ext/spl/examples/dualiterator.inc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/** @ingroup Examples
1313
* @brief Synchronous iteration over two iterators
1414
* @author Marcus Boerger
15-
* @version 1.1
15+
* @version 1.2
1616
*/
1717
class DualIterator implements Iterator
1818
{
@@ -174,6 +174,7 @@ class DualIterator implements Iterator
174174
{
175175
$it = new RecursiveDualIterator($lhs, $rhs,
176176
self::CURRENT_0 | self::KEY_0);
177+
$it = new RecursiveIteratorIterator($it);
177178
}
178179
else
179180
{
@@ -187,7 +188,7 @@ class DualIterator implements Iterator
187188

188189
if ($identical)
189190
{
190-
foreach(new RecursiveIteratorIterator($it) as $n)
191+
foreach($it as $n)
191192
{
192193
if (!$it->areIdentical())
193194
{

0 commit comments

Comments
 (0)