xref: /PHP-8.4/ext/simplexml/tests/bug46003.phpt (revision 7f2f0c00)
1--TEST--
2Bug #46003 (isset on nonexisting nodes return unexpected results)
3--EXTENSIONS--
4simplexml
5--FILE--
6<?php
7$xml =<<<XML
8<r>
9  <p>Test</p>
10  <o d='h'>
11    <xx rr='info' />
12    <yy rr='data' />
13  </o>
14</r>
15XML;
16
17$x = simplexml_load_string($xml);
18
19var_dump(isset($x->p));
20var_dump(isset($x->p->o));
21var_dump(isset($x->o->yy));
22var_dump(isset($x->o->zz));
23var_dump(isset($x->o->text));
24var_dump(isset($x->o->xx));
25?>
26--EXPECT--
27bool(true)
28bool(false)
29bool(true)
30bool(false)
31bool(false)
32bool(true)
33
34