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-- SimpleXML: echo/print --EXTENSIONS-- simplexml --FILE-- <?php $xml =<<<EOF <?xml..

Decoded Output download

--TEST--
SimpleXML: echo/print
--EXTENSIONS--
simplexml
--FILE--
<?php

$xml =<<<EOF
<?xml version="1.0" encoding="ISO-8859-1" ?>
<foo>
  <bar>bar</bar>
  <baz>baz1</baz>
  <baz>baz2</baz>
</foo>
EOF;

$sxe = simplexml_load_string($xml);

echo "===BAR===
";
echo $sxe->bar;
echo "
";

echo "===BAZ===
";
echo $sxe->baz;
echo "
";

echo "===BAZ0===
";
echo $sxe->baz[0];
echo "
";

echo "===BAZ1===
";
print $sxe->baz[1];
echo "
";
?>
--EXPECT--
===BAR===
bar
===BAZ===
baz1
===BAZ0===
baz1
===BAZ1===
baz2

Did this file decode correctly?

Original Code

--TEST--
SimpleXML: echo/print
--EXTENSIONS--
simplexml
--FILE--
<?php

$xml =<<<EOF
<?xml version="1.0" encoding="ISO-8859-1" ?>
<foo>
  <bar>bar</bar>
  <baz>baz1</baz>
  <baz>baz2</baz>
</foo>
EOF;

$sxe = simplexml_load_string($xml);

echo "===BAR===\n";
echo $sxe->bar;
echo "\n";

echo "===BAZ===\n";
echo $sxe->baz;
echo "\n";

echo "===BAZ0===\n";
echo $sxe->baz[0];
echo "\n";

echo "===BAZ1===\n";
print $sxe->baz[1];
echo "\n";
?>
--EXPECT--
===BAR===
bar
===BAZ===
baz1
===BAZ0===
baz1
===BAZ1===
baz2

Function Calls

simplexml_load_string 1

Variables

$xml <?xml version="1.0" encoding="ISO-8859-1" ?> <foo> <bar>ba..

Stats

MD5 21b2d9ec4b3106fa6afb623ba2268021
Eval Count 0
Decode Time 80 ms