3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @link http://stackoverflow.com/a/29864193/367456 */ $buffer = <<<XML <?xml version="1.0"?> <!DOCTYPE foo [ <!ELEMENT foo ANY > <!ENTITY xxe SYSTEM "/etc/passwd">]><foo>&xxe;</foo> XML; libxml_disable_entity_loader(false); $xml = simplexml_load_string($buffer); $xml->asXML('php://output'); $xml = simplexml_load_string($buffer, 'SimpleXMLElement', LIBXML_NOENT); $xml->asXML('php://output');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/atLd6
function name:  (null)
number of ops:  21
compiled vars:  !0 = $buffer, !1 = $xml
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22%3F%3E%0A+%3C%21DOCTYPE+foo+%5B++%0A++%3C%21ELEMENT+foo+ANY+%3E%0A++%3C%21ENTITY+xxe+SYSTEM+%22%2Fetc%2Fpasswd%22%3E%5D%3E%3Cfoo%3E%26xxe%3B%3C%2Ffoo%3E'
   14     1        INIT_FCALL                                               'libxml_disable_entity_loader'
          2        SEND_VAL                                                 <false>
          3        DO_FCALL_BY_NAME                                         
   16     4        INIT_FCALL                                               'simplexml_load_string'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                         $4      
          7        ASSIGN                                                   !1, $4
   17     8        INIT_METHOD_CALL                                         !1, 'asXML'
          9        SEND_VAL_EX                                              'php%3A%2F%2Foutput'
         10        DO_FCALL                                      0          
   19    11        INIT_FCALL                                               'simplexml_load_string'
         12        SEND_VAR                                                 !0
         13        SEND_VAL                                                 'SimpleXMLElement'
         14        SEND_VAL                                                 2
         15        DO_ICALL                                         $7      
         16        ASSIGN                                                   !1, $7
   20    17        INIT_METHOD_CALL                                         !1, 'asXML'
         18        SEND_VAL_EX                                              'php%3A%2F%2Foutput'
         19        DO_FCALL                                      0          
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.92 ms | 1395 KiB | 17 Q