Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

--TEST-- Bug #46047 (SimpleXML converts empty nodes into object with nested array) --EXTEN..

Decoded Output download

--TEST--
Bug #46047 (SimpleXML converts empty nodes into object with nested array)
--EXTENSIONS--
simplexml
--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);
?>
--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
        (
        )

)
	

Did this file decode correctly?

Original Code

--TEST--
Bug #46047 (SimpleXML converts empty nodes into object with nested array)
--EXTENSIONS--
simplexml
--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);
?>
--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
        (
        )

)
	

Function Calls

None

Variables

None

Stats

MD5 83c794b72891a2688539ea30ccd1182b
Eval Count 0
Decode Time 99 ms