diff --git a/src/Language/AST/NodeList.php b/src/Language/AST/NodeList.php index c91fbcf..648f68a 100644 --- a/src/Language/AST/NodeList.php +++ b/src/Language/AST/NodeList.php @@ -114,7 +114,7 @@ class NodeList implements ArrayAccess, IteratorAggregate, Countable */ public function getIterator() { - foreach (array_keys($this->nodes) as $key) { + foreach ($this->nodes as $key => $_) { yield $this->offsetGet($key); } }