[GIT-PULLS] [php-src] PR #22701: ext/dom: getElementsByClassName() item() returns wrong element on ran…
[email protected] (devnexen)
| Newsgroups | php.git-pulls |
|---|---|
| Message-ID | <V6YLdqHBuqwbRQoQcAYT9DEqlzRNV2nbaUtX9L9Fbkw@main.internal.php.net> |
Pull Request: https://github.com/php/php-src/pull/22701 Author: devnexen …dom access. The loop never advanced past the current match, so a cold item($n) with $n >= 1, or a backwards seek, returned the first match. Fixed by mirroring dom_map_get_elements_item(): advance to the next match once per remaining index.