From c92bed4580bcf7cc3586d9c0f0fca2a05b1d083e Mon Sep 17 00:00:00 2001 From: David Grudl Date: Tue, 24 Sep 2019 12:52:34 +0200 Subject: [PATCH] CachingIterator: fixed IteratorAggregate -> Iterator conversion --- src/Latte/Runtime/CachingIterator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Latte/Runtime/CachingIterator.php b/src/Latte/Runtime/CachingIterator.php index 39ac77e3b7..191e1c572c 100644 --- a/src/Latte/Runtime/CachingIterator.php +++ b/src/Latte/Runtime/CachingIterator.php @@ -41,7 +41,7 @@ public function __construct($iterator) } elseif ($iterator instanceof \IteratorAggregate) { do { $iterator = $iterator->getIterator(); - } while ($iterator instanceof \IteratorAggregate); + } while (!$iterator instanceof \Iterator); } elseif ($iterator instanceof \Traversable) { if (!$iterator instanceof \Iterator) {