3v4l.org

run code in 300+ PHP versions simultaneously
<?php $doc = new DOMDocument(); $doc->loadXML('<root><foo name="lorem"/><bar><foo name="ipsum"/><foo name="dolor"/></bar><foo name="sit"/></root>'); $foos = $doc->getElementsByTagName("foo"); foreach ($foos as $foo) { echo "<", $foo->tagName, "> ", $foo->getAttribute("name"), "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 22
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 22
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 22
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 22
filename:       /in/mMQZb
function name:  (null)
number of ops:  24
compiled vars:  !0 = $doc, !1 = $foos, !2 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $3      'DOMDocument'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $3
    3     3        INIT_METHOD_CALL                                         !0, 'loadXML'
          4        SEND_VAL_EX                                              '%3Croot%3E%3Cfoo+name%3D%22lorem%22%2F%3E%3Cbar%3E%3Cfoo+name%3D%22ipsum%22%2F%3E%3Cfoo+name%3D%22dolor%22%2F%3E%3C%2Fbar%3E%3Cfoo+name%3D%22sit%22%2F%3E%3C%2Froot%3E'
          5        DO_FCALL                                      0          
    4     6        INIT_METHOD_CALL                                         !0, 'getElementsByTagName'
          7        SEND_VAL_EX                                              'foo'
          8        DO_FCALL                                      0  $7      
          9        ASSIGN                                                   !1, $7
    5    10      > FE_RESET_R                                       $9      !1, ->22
         11    > > FE_FETCH_R                                               $9, !2, ->22
    6    12    >   ECHO                                                     '%3C'
         13        FETCH_OBJ_R                                      ~10     !2, 'tagName'
         14        ECHO                                                     ~10
         15        ECHO                                                     '%3E+'
         16        INIT_METHOD_CALL                                         !2, 'getAttribute'
         17        SEND_VAL_EX                                              'name'
         18        DO_FCALL                                      0  $11     
         19        ECHO                                                     $11
         20        ECHO                                                     '%0A'
    5    21      > JMP                                                      ->11
         22    >   FE_FREE                                                  $9
    7    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.22 ms | 1394 KiB | 13 Q