1
0
mirror of https://github.com/php/php-src.git synced 2026-04-18 13:31:27 +02:00
Files
archived-php-src/ext/simplexml/tests/bug46047.phpt
2018-10-14 19:46:15 +02:00

53 lines
892 B
PHP

--TEST--
Bug #46047 (SimpleXML converts empty nodes into object with nested array)
--SKIPIF--
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php
$xml = new SimpleXMLElement('<foo><bar><![CDATA[]]></bar><baz/></foo>',
LIBXML_NOCDATA);
print_r($xml);
$xml = new SimpleXMLElement('<foo><bar></bar><baz/></foo>');
print_r($xml);
$xml = new SimpleXMLElement('<foo><bar/><baz/></foo>');
print_r($xml);
?>
===DONE===
--EXPECT--
SimpleXMLElement Object
(
[bar] => SimpleXMLElement Object
(
)
[baz] => SimpleXMLElement Object
(
)
)
SimpleXMLElement Object
(
[bar] => SimpleXMLElement Object
(
)
[baz] => SimpleXMLElement Object
(
)
)
SimpleXMLElement Object
(
[bar] => SimpleXMLElement Object
(
)
[baz] => SimpleXMLElement Object
(
)
)
===DONE===