xref: /PHP-8.2/ext/simplexml/tests/bug61335.phpt (revision 7f2f0c00)
1--TEST--
2Bug #61335 - Access to array node returns wrong truth value
3--EXTENSIONS--
4simplexml
5--FILE--
6<?php
7$rec1 = simplexml_load_string("<foo><bar>aa</bar>\n</foo>");
8$rec2 = simplexml_load_string("<foo><bar>aa</bar></foo>");
9
10if ($rec1->bar[0])      echo "NONEMPTY1\n";
11if ($rec1->bar[0] . "") echo "NONEMPTY2\n";
12if ($rec2->bar[0])      echo "NONEMPTY3\n";
13?>
14--EXPECT--
15NONEMPTY1
16NONEMPTY2
17NONEMPTY3
18