3v4l.org

run code in 300+ PHP versions simultaneously
<?php $me = __FILE__; $xml = <<<ENDOFXML <!DOCTYPE root [ <!ENTITY foo SYSTEM "php://filter/convert.base64-encode/resource=$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));
Output for 7.4.0 - 7.4.30, 8.0.1 - 8.0.20, 8.1.0 - 8.1.7
libxml version: 2.9.4 object(SimpleXMLElement)#1 (1) { [0]=> string(436) "PD9waHAKJG1lID0gX19GSUxFX187CiR4bWwgPSA8PDxFTkRPRlhNTAo8IURPQ1RZUEUgcm9vdApbCjwhRU5USVRZIGZvbyBTWVNURU0gInBocDovL2ZpbHRlci9jb252ZXJ0LmJhc2U2NC1lbmNvZGUvcmVzb3VyY2U9JG1lIj4KXT4KPGZvbz4mZm9vOzwvZm9vPgpFTkRPRlhNTDsKCmVjaG8gImxpYnhtbCB2ZXJzaW9uOiAiIC4gTElCWE1MX0RPVFRFRF9WRVJTSU9OIC4gIlxuXG4iOwokcyA9IHNpbXBsZXhtbF9sb2FkX3N0cmluZygkeG1sLCBudWxsLCBMSUJYTUxfTk9FTlQpOwp2YXJfZHVtcCgkcyk7CmVjaG8gIlxuIjsKdmFyX2R1bXAoYmFzZTY0X2RlY29kZSgkcykpOw==" } string(325) "<?php $me = __FILE__; $xml = <<<ENDOFXML <!DOCTYPE root [ <!ENTITY foo SYSTEM "php://filter/convert.base64-encode/resource=$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));"

preferences:
18.8 ms | 415 KiB | 6 Q