Skip to content

Commit d274b1c

Browse files
author
Greg Bowler
authored
Rewind iterator before first use (#213)
1 parent 8b9cb8d commit d274b1c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/HTMLCollection.php

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class HTMLCollection extends NodeList {
1818
/** @noinspection PhpMissingParentConstructorInspection */
1919
public function __construct(DOMNodeList $domNodeList) {
2020
$this->list = [];
21+
$this->rewind();
2122

2223
for($i = 0, $n = $domNodeList->length; $i < $n; $i++) {
2324
$item = $domNodeList->item($i);

0 commit comments

Comments
 (0)