3v4l.org

run code in 500+ 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/plain,test" >]><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/LiEKI
function name:  (null)
number of ops:  21
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%2Fplain%2Ctest%22+%3E%5D%3E%3Cfoo%3E%26xxe%3B%3C%2Ffoo%3E'
   13     1        INIT_FCALL                                                   'libxml_disable_entity_loader'
          2        SEND_VAL                                                     <false>
          3        DO_FCALL_BY_NAME                                             
   15     4        INIT_FCALL                                                   'simplexml_load_string'
          5        SEND_VAR                                                     !0
          6        DO_ICALL                                             $4      
          7        ASSIGN                                                       !1, $4
   16     8        INIT_METHOD_CALL                                             !1, 'asXML'
          9        SEND_VAL_EX                                                  'php%3A%2F%2Foutput'
         10        DO_FCALL                                          0          
   18    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
   19    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.5.0


preferences:
196.44 ms | 3082 KiB | 15 Q