xref: /PHP-8.1/ext/dom/tests/bug35342.phpt (revision bd9f4fa6)
1--TEST--
2Bug #35342 (isset(DOMNodeList->length) returns false)
3--EXTENSIONS--
4dom
5--FILE--
6<?php
7$dom = new DOMDocument();
8$dom->loadXML("<root><foo>foobar</foo><foo>foobar#2</foo></root>");
9
10$nodelist = $dom->getElementsByTagName("foo");
11
12var_dump($nodelist->length, isset($nodelist->length), isset($nodelist->foo));
13var_dump(empty($nodelist->length), empty($nodelist->foo));
14?>
15--EXPECT--
16int(2)
17bool(true)
18bool(false)
19bool(false)
20bool(true)
21