xref: /PHP-8.1/ext/dom/tests/bug67474.phpt (revision bd9f4fa6)
1--TEST--
2Bug #67474 getElementsByTagNameNS and default namespace
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7declare(strict_types=1);
8
9$doc = new DOMDocument();
10$doc->loadXML('<root xmlns:x="x"><a/><x:a/></root>');
11$list = $doc->getElementsByTagNameNS('', 'a');
12var_dump($list->length);
13$list = $doc->getElementsByTagNameNS(null, 'a');
14var_dump($list->length);
15
16$elem = $doc->documentElement;
17$list = $elem->getElementsByTagNameNS('', 'a');
18var_dump($list->length);
19$list = $elem->getElementsByTagNameNS(null, 'a');
20var_dump($list->length);
21
22?>
23--EXPECT--
24int(1)
25int(1)
26int(1)
27int(1)
28