3v4l.org

run code in 300+ PHP versions simultaneously
<?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));
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.31, 8.2.0 - 8.2.27, 8.3.0 - 8.3.15, 8.4.1 - 8.4.2
libxml version: 2.9.4 Warning: simplexml_load_string(): /in/1rlRV:15: parser error : ParsePI: PI php never end ... in /in/1rlRV on line 12 Warning: simplexml_load_string(): var_dump(base64_decode($s)); in /in/1rlRV on line 12 Warning: simplexml_load_string(): ^ in /in/1rlRV on line 12 Warning: simplexml_load_string(): Entity: line 5: parser error : Failure to process entity foo in /in/1rlRV on line 12 Warning: simplexml_load_string(): <foo>&foo;</foo> in /in/1rlRV on line 12 Warning: simplexml_load_string(): ^ in /in/1rlRV on line 12 Warning: simplexml_load_string(): Entity: line 5: parser error : Entity 'foo' not defined in /in/1rlRV on line 12 Warning: simplexml_load_string(): <foo>&foo;</foo> in /in/1rlRV on line 12 Warning: simplexml_load_string(): ^ in /in/1rlRV on line 12 bool(false) string(0) ""

preferences:
68 ms | 409 KiB | 5 Q