3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = "<root> <parent> <child name='Child1'>Moi</child> <child name='Child2'>Terve</child> <subparent> <child name='Child3'>Hei</child> </subparent> </parent> <child name='Child4' /> </root>"; $xml = simplexml_load_string( $xml); $result = $xml->xpath('subparent/child'); while(list( , $node) = each($result)) { echo 'b/c: ',$node,"\n"; }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 13
Branch analysis from position: 13
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 10
Branch analysis from position: 19
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 10
2 jumps found. (Code = 44) Position 1 = 19, Position 2 = 10
Branch analysis from position: 19
Branch analysis from position: 10
filename:       /in/QvfRb
function name:  (null)
number of ops:  20
compiled vars:  !0 = $xml, !1 = $result, !2 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Croot%3E%0A++++%3Cparent%3E%0A%3Cchild+name%3D%27Child1%27%3EMoi%3C%2Fchild%3E%0A%3Cchild+name%3D%27Child2%27%3ETerve%3C%2Fchild%3E%0A++++++++%3Csubparent%3E%0A%3Cchild+name%3D%27Child3%27%3EHei%3C%2Fchild%3E%0A++++++++%3C%2Fsubparent%3E%0A++++%3C%2Fparent%3E%0A++++%3Cchild+name%3D%27Child4%27+%2F%3E%0A%3C%2Froot%3E'
   13     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !0, $4
   15     5        INIT_METHOD_CALL                                         !0, 'xpath'
          6        SEND_VAL_EX                                              'subparent%2Fchild'
          7        DO_FCALL                                      0  $6      
          8        ASSIGN                                                   !1, $6
   17     9      > JMP                                                      ->13
   18    10    >   ECHO                                                     'b%2Fc%3A+'
         11        ECHO                                                     !2
         12        ECHO                                                     '%0A'
   17    13    >   INIT_FCALL_BY_NAME                                       'each'
         14        SEND_VAR_EX                                              !1
         15        DO_FCALL                                      0  $8      
         16        FETCH_LIST_R                                     $9      $8, 1
         17        ASSIGN                                                   !2, $9
         18      > JMPNZ                                                    $8, ->10
   19    19    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.73 ms | 1387 KiB | 15 Q