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 "data://text/html,aaaa" >]><foo>&xxe;</foo> XML; //libxml_disable_entity_loader(false); $xml = simplexml_load_string($buffer); var_dump($xml); echo 'break\n\r'; $xml = simplexml_load_string($buffer, 'SimpleXMLElement', LIBXML_NOENT); var_dump($xml);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/B0q59
function name:  (null)
number of ops:  19
compiled vars:  !0 = $buffer, !1 = $xml
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     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+%22data%3A%2F%2Ftext%2Fhtml%2Caaaa%22+%3E%5D%3E%3Cfoo%3E%26xxe%3B%3C%2Ffoo%3E'
   15     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
   16     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
   18     8        ECHO                                                     'break%5Cn%5Cr'
   19     9        INIT_FCALL                                               'simplexml_load_string'
         10        SEND_VAR                                                 !0
         11        SEND_VAL                                                 'SimpleXMLElement'
         12        SEND_VAL                                                 2
         13        DO_ICALL                                         $6      
         14        ASSIGN                                                   !1, $6
   20    15        INIT_FCALL                                               'var_dump'
         16        SEND_VAR                                                 !1
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.24 ms | 1395 KiB | 17 Q