xref: /PHP-8.4/ext/dom/tests/gh16906.phpt (revision 9d39ff76)
1--TEST--
2GH-16906 (Reloading document can cause UAF in iterator)
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$doc = new DOMDocument;
8$doc->loadXML('<?xml version="1.0"?><span><strong id="1"/><strong id="2"/></span>');
9$list = $doc->getElementsByTagName('strong');
10$doc->load(__DIR__."/book.xml");
11var_dump($list);
12?>
13--EXPECT--
14object(DOMNodeList)#2 (1) {
15  ["length"]=>
16  int(0)
17}
18