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"; libxml_disable_entity_loader(); $s = simplexml_load_string($xml, null, LIBXML_NOENT); var_dump($s); echo "\n"; var_dump(base64_decode($s));
Output for 8.0.1 - 8.0.20, 8.1.0 - 8.1.7
libxml version: 2.9.4 Deprecated: Function libxml_disable_entity_loader() is deprecated in /in/Pso2C on line 12 Warning: simplexml_load_string(): I/O warning : failed to load external entity "php://filter/convert.base64-encode/resource=/in/Pso2C" in /in/Pso2C on line 13 Warning: simplexml_load_string(): Entity: line 5: parser error : Failure to process entity foo in /in/Pso2C on line 13 Warning: simplexml_load_string(): <foo>&foo;</foo> in /in/Pso2C on line 13 Warning: simplexml_load_string(): ^ in /in/Pso2C on line 13 Warning: simplexml_load_string(): Entity: line 5: parser error : Entity 'foo' not defined in /in/Pso2C on line 13 Warning: simplexml_load_string(): <foo>&foo;</foo> in /in/Pso2C on line 13 Warning: simplexml_load_string(): ^ in /in/Pso2C on line 13 bool(false) string(0) ""
Output for 7.4.0 - 7.4.30
libxml version: 2.9.4 Warning: simplexml_load_string(): I/O warning : failed to load external entity "php://filter/convert.base64-encode/resource=/in/Pso2C" in /in/Pso2C on line 13 Warning: simplexml_load_string(): Entity: line 5: parser error : Failure to process entity foo in /in/Pso2C on line 13 Warning: simplexml_load_string(): <foo>&foo;</foo> in /in/Pso2C on line 13 Warning: simplexml_load_string(): ^ in /in/Pso2C on line 13 Warning: simplexml_load_string(): Entity: line 5: parser error : Entity 'foo' not defined in /in/Pso2C on line 13 Warning: simplexml_load_string(): <foo>&foo;</foo> in /in/Pso2C on line 13 Warning: simplexml_load_string(): ^ in /in/Pso2C on line 13 bool(false) string(0) ""

preferences:
16.42 ms | 412 KiB | 5 Q