3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <?xml version="1.0" ?> <root><child><grandchild/></child><child><grandchild/></child></root> XML; $doc = new DOMDocument; $doc->loadXML($xml); foreach ($doc->documentElement->childNodes as $el) { echo $el->tagName . "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 15
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/dNTGf
function name:  (null)
number of ops:  17
compiled vars:  !0 = $xml, !1 = $doc, !2 = $el
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+%3F%3E%0A%3Croot%3E%3Cchild%3E%3Cgrandchild%2F%3E%3C%2Fchild%3E%3Cchild%3E%3Cgrandchild%2F%3E%3C%2Fchild%3E%3C%2Froot%3E'
    8     1        NEW                                              $4      'DOMDocument'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $4
    9     4        INIT_METHOD_CALL                                         !1, 'loadXML'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
   10     7        FETCH_OBJ_R                                      ~8      !1, 'documentElement'
          8        FETCH_OBJ_R                                      ~9      ~8, 'childNodes'
          9      > FE_RESET_R                                       $10     ~9, ->15
         10    > > FE_FETCH_R                                               $10, !2, ->15
   11    11    >   FETCH_OBJ_R                                      ~11     !2, 'tagName'
         12        CONCAT                                           ~12     ~11, '%0A'
         13        ECHO                                                     ~12
   10    14      > JMP                                                      ->10
         15    >   FE_FREE                                                  $10
   12    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
232.59 ms | 996 KiB | 13 Q