- var_dump: documentation ( source)
- base64_decode: documentation ( source)
- simplexml_load_string: documentation ( source)
<?php
$me = __FILE__;
$xml = <<<ENDOFXML
<!DOCTYPE root
[
<!ENTITY foo SYSTEM "$me">
]>
<foo>&foo;</foo>
ENDOFXML;
echo "libxml version: " . LIBXML_DOTTED_VERSION . "\n\n";
$s = simplexml_load_string($xml, null, LIBXML_NOENT);
var_dump($s);
echo "\n";
var_dump(base64_decode($s));