mirror of
https://github.com/php/php-src.git
synced 2025-08-20 09:24:05 +02:00
- MFH: Fix handling of recursive inner iterators
This commit is contained in:
parent
5f3e233ea7
commit
5ea32dc1e4
1 changed files with 3 additions and 2 deletions
|
@ -12,7 +12,7 @@
|
||||||
/** @ingroup Examples
|
/** @ingroup Examples
|
||||||
* @brief Synchronous iteration over two iterators
|
* @brief Synchronous iteration over two iterators
|
||||||
* @author Marcus Boerger
|
* @author Marcus Boerger
|
||||||
* @version 1.1
|
* @version 1.2
|
||||||
*/
|
*/
|
||||||
class DualIterator implements Iterator
|
class DualIterator implements Iterator
|
||||||
{
|
{
|
||||||
|
@ -174,6 +174,7 @@ class DualIterator implements Iterator
|
||||||
{
|
{
|
||||||
$it = new RecursiveDualIterator($lhs, $rhs,
|
$it = new RecursiveDualIterator($lhs, $rhs,
|
||||||
self::CURRENT_0 | self::KEY_0);
|
self::CURRENT_0 | self::KEY_0);
|
||||||
|
$it = new RecursiveIteratorIterator($it);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -187,7 +188,7 @@ class DualIterator implements Iterator
|
||||||
|
|
||||||
if ($identical)
|
if ($identical)
|
||||||
{
|
{
|
||||||
foreach(new RecursiveIteratorIterator($it) as $n)
|
foreach($it as $n)
|
||||||
{
|
{
|
||||||
if (!$it->areIdentical())
|
if (!$it->areIdentical())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue