3v4l.org

run code in 300+ PHP versions simultaneously
<?php $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 "trying New SimpleXMLElement($xml)"; $xml = new SimpleXMLElement($buffer); var_dump($xml); echo 'Enabling LIBXML_NOENT for test reasons'; $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/h7j67
function name:  (null)
number of ops:  30
compiled vars:  !0 = $buffer, !1 = $xml
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     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'
   12     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
   13     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
   14     8        ROPE_INIT                                     3  ~7      'trying+New+SimpleXMLElement%28'
          9        ROPE_ADD                                      1  ~7      ~7, !1
         10        ROPE_END                                      2  ~6      ~7, '%29'
         11        ECHO                                                     ~6
   15    12        NEW                                              $9      'SimpleXMLElement'
         13        SEND_VAR_EX                                              !0
         14        DO_FCALL                                      0          
         15        ASSIGN                                                   !1, $9
   16    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                                 
   18    19        ECHO                                                     'Enabling+LIBXML_NOENT+for+test+reasons'
   19    20        INIT_FCALL                                               'simplexml_load_string'
         21        SEND_VAR                                                 !0
         22        SEND_VAL                                                 'SimpleXMLElement'
         23        SEND_VAL                                                 2
         24        DO_ICALL                                         $13     
         25        ASSIGN                                                   !1, $13
   20    26        INIT_FCALL                                               'var_dump'
         27        SEND_VAR                                                 !1
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.99 ms | 1461 KiB | 15 Q