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