1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 09:42:22 +01:00
Files
archived-php-src/ext/simplexml/tests/bug46047.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

53 lines
893 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===