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 [profile]: Accessing an aliased namespaced attribute --EXTENSIONS-- sim..
Decoded Output download
--TEST--
SimpleXML [profile]: Accessing an aliased namespaced attribute
--EXTENSIONS--
simplexml
--FILE--
<?php
error_reporting(E_ALL & ~E_NOTICE);
$root = simplexml_load_string('<?xml version="1.0"?>
<root xmlns:reserved="reserved-ns">
<child reserved:attribute="Sample" />
</root>
');
$rsattr = $root->child->attributes('reserved');
$myattr = $root->child->attributes('reserved-ns');
echo $rsattr['attribute'];
echo $myattr['attribute'];
echo "
---Done---
";
?>
--EXPECT--
Sample
---Done---
Did this file decode correctly?
Original Code
--TEST--
SimpleXML [profile]: Accessing an aliased namespaced attribute
--EXTENSIONS--
simplexml
--FILE--
<?php
error_reporting(E_ALL & ~E_NOTICE);
$root = simplexml_load_string('<?xml version="1.0"?>
<root xmlns:reserved="reserved-ns">
<child reserved:attribute="Sample" />
</root>
');
$rsattr = $root->child->attributes('reserved');
$myattr = $root->child->attributes('reserved-ns');
echo $rsattr['attribute'];
echo $myattr['attribute'];
echo "\n---Done---\n";
?>
--EXPECT--
Sample
---Done---
Function Calls
None |
Stats
MD5 | 6cb05117eb56d0dbedf5314f9dcb5ddf |
Eval Count | 0 |
Decode Time | 84 ms |