diff --git a/src/Runtime/LoopIterator.php b/src/Runtime/LoopIterator.php index a1112a83ff..db9c0ce717 100644 --- a/src/Runtime/LoopIterator.php +++ b/src/Runtime/LoopIterator.php @@ -49,10 +49,9 @@ public function __construct($seq) $seq = $seq->getIterator(); } while ($seq instanceof \IteratorAggregate); $this->seq = $seq; - } elseif ($seq instanceof \Iterator) { - $this->seq = $seq; } elseif (is_iterable($seq)) { - $this->seq = new \IteratorIterator($seq); + /** @var \Iterator $seq */ + $this->seq = $seq; } else { $this->seq = new \EmptyIterator(); }