3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE foo [ <!ELEMENT foo ANY > <!ENTITY xxe SYSTEM "http://ss23.geek.nz/viper-test.txt" > ]> <foo>&xxe;</foo> XML; $x = new DOMDocument(); $x->loadXML($xml); foreach ($x->getElementsByTagName('foo') as $u) { var_dump($u->nodeValue); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 17
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/cLWKk
function name:  (null)
number of ops:  19
compiled vars:  !0 = $xml, !1 = $x, !2 = $u
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22+%3F%3E%0A%3C%21DOCTYPE+foo+%5B%0A%3C%21ELEMENT+foo+ANY+%3E%0A%3C%21ENTITY+xxe+SYSTEM+%22http%3A%2F%2Fss23.geek.nz%2Fviper-test.txt%22+%3E%0A%5D%3E%0A%3Cfoo%3E%26xxe%3B%3C%2Ffoo%3E'
   12     1        NEW                                              $4      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
   13     4        INIT_METHOD_CALL                                         !1, 'loadXML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   15     7        INIT_METHOD_CALL                                         !1, 'getElementsByTagName'
          8        SEND_VAL_EX                                              'foo'
          9        DO_FCALL                                      0  $8      
         10      > FE_RESET_R                                       $9      $8, ->17
         11    > > FE_FETCH_R                                               $9, !2, ->17
   16    12    >   INIT_FCALL                                               'var_dump'
         13        FETCH_OBJ_R                                      ~10     !2, 'nodeValue'
         14        SEND_VAL                                                 ~10
         15        DO_ICALL                                                 
   15    16      > JMP                                                      ->11
         17    >   FE_FREE                                                  $9
   17    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.18 ms | 1395 KiB | 15 Q