3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dom = new DOMDOcument(); $dom->load("myxmlfile.xml"); foreach($dom->documentElement->childNodes as $child) { if(($child->nodeType == XML_ELEMENT_NODE) && $child->nodeName == "item") { foreach($child->childNodes as $item) { if(($item->nodeType == XML_ELEMENT_NODE) && ($item->nodeName == "title")) { print "$item->firstChild->data\n"; } } } } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 34
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 34
Branch analysis from position: 10
2 jumps found. (Code = 46) Position 1 = 13, Position 2 = 16
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 33
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 32
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 32
Branch analysis from position: 20
2 jumps found. (Code = 46) Position 1 = 23, Position 2 = 26
Branch analysis from position: 23
2 jumps found. (Code = 43) Position 1 = 27, Position 2 = 31
Branch analysis from position: 27
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 31
Branch analysis from position: 26
Branch analysis from position: 32
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 32
Branch analysis from position: 33
Branch analysis from position: 16
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/q6tSg
function name:  (null)
number of ops:  36
compiled vars:  !0 = $dom, !1 = $child, !2 = $item
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, 'load'
          4        SEND_VAL_EX                                              'myxmlfile.xml'
          5        DO_FCALL                                      0          
    5     6        FETCH_OBJ_R                                      ~7      !0, 'documentElement'
          7        FETCH_OBJ_R                                      ~8      ~7, 'childNodes'
          8      > FE_RESET_R                                       $9      ~8, ->34
          9    > > FE_FETCH_R                                               $9, !1, ->34
    7    10    >   FETCH_OBJ_R                                      ~10     !1, 'nodeType'
         11        IS_EQUAL                                         ~11     ~10, 1
         12      > JMPZ_EX                                          ~11     ~11, ->16
    8    13    >   FETCH_OBJ_R                                      ~12     !1, 'nodeName'
         14        IS_EQUAL                                         ~13     ~12, 'item'
         15        BOOL                                             ~11     ~13
         16    > > JMPZ                                                     ~11, ->33
   10    17    >   FETCH_OBJ_R                                      ~14     !1, 'childNodes'
         18      > FE_RESET_R                                       $15     ~14, ->32
         19    > > FE_FETCH_R                                               $15, !2, ->32
   12    20    >   FETCH_OBJ_R                                      ~16     !2, 'nodeType'
         21        IS_EQUAL                                         ~17     ~16, 1
         22      > JMPZ_EX                                          ~17     ~17, ->26
   13    23    >   FETCH_OBJ_R                                      ~18     !2, 'nodeName'
         24        IS_EQUAL                                         ~19     ~18, 'title'
         25        BOOL                                             ~17     ~19
         26    > > JMPZ                                                     ~17, ->31
   15    27    >   FETCH_OBJ_R                                      ~20     !2, 'firstChild'
         28        NOP                                                      
         29        FAST_CONCAT                                      ~21     ~20, '-%3Edata%0A'
         30        ECHO                                                     ~21
   10    31    > > JMP                                                      ->19
         32    >   FE_FREE                                                  $15
    5    33    > > JMP                                                      ->9
         34    >   FE_FREE                                                  $9
   20    35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147 ms | 1390 KiB | 13 Q