3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = <<<XML <root> <a> <b> <id>123</id> <name>Daughter</name> <a> <b> <id>234</id> <name>Mom</name> <c>1</c> <a> <b> <id>345</id> <name>Grandma</name> </b> </a> </b> </a> </b> </a> </root> XML; $xml = simplexml_load_string($xml); foreach ($xml->xpath('//b') as $item) { echo $item->id . $item->name . PHP_EOL; } foreach ($xml->xpath('//name') as $name) { echo $name . PHP_EOL; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 16
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 16
2 jumps found. (Code = 77) Position 1 = 21, Position 2 = 25
Branch analysis from position: 21
2 jumps found. (Code = 78) Position 1 = 22, Position 2 = 25
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 21
Branch analysis from position: 21
Branch analysis from position: 25
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 25
Branch analysis from position: 16
filename:       /in/tYeBi
function name:  (null)
number of ops:  27
compiled vars:  !0 = $xml, !1 = $item, !2 = $name
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3Croot%3E%0A%3Ca%3E%0A++++%3Cb%3E%0A++++++++%3Cid%3E123%3C%2Fid%3E%0A++++++++%3Cname%3EDaughter%3C%2Fname%3E%0A++++++++%3Ca%3E%0A++++++++++++%3Cb%3E%0A++++++++++++++++%3Cid%3E234%3C%2Fid%3E%0A++++++++++++++++%3Cname%3EMom%3C%2Fname%3E%0A++++++++++++++++%3Cc%3E1%3C%2Fc%3E%0A++++++++++++++++%3Ca%3E%0A++++++++++++++++++++%3Cb%3E%0A++++++++++++++++++++++++%3Cid%3E345%3C%2Fid%3E%0A++++++++++++++++++++++++%3Cname%3EGrandma%3C%2Fname%3E%0A++++++++++++++++++++%3C%2Fb%3E%0A++++++++++++++++%3C%2Fa%3E%0A++++++++++++%3C%2Fb%3E%0A++++++++%3C%2Fa%3E%0A++++%3C%2Fb%3E%0A%3C%2Fa%3E%0A%3C%2Froot%3E'
   27     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !0, $4
   29     5        INIT_METHOD_CALL                                         !0, 'xpath'
          6        SEND_VAL_EX                                              '%2F%2Fb'
          7        DO_FCALL                                      0  $6      
          8      > FE_RESET_R                                       $7      $6, ->16
          9    > > FE_FETCH_R                                               $7, !1, ->16
   30    10    >   FETCH_OBJ_R                                      ~8      !1, 'id'
         11        FETCH_OBJ_R                                      ~9      !1, 'name'
         12        CONCAT                                           ~10     ~8, ~9
         13        CONCAT                                           ~11     ~10, '%0A'
         14        ECHO                                                     ~11
   29    15      > JMP                                                      ->9
         16    >   FE_FREE                                                  $7
   32    17        INIT_METHOD_CALL                                         !0, 'xpath'
         18        SEND_VAL_EX                                              '%2F%2Fname'
         19        DO_FCALL                                      0  $12     
         20      > FE_RESET_R                                       $13     $12, ->25
         21    > > FE_FETCH_R                                               $13, !2, ->25
   33    22    >   CONCAT                                           ~14     !2, '%0A'
         23        ECHO                                                     ~14
   32    24      > JMP                                                      ->21
         25    >   FE_FREE                                                  $13
   34    26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.39 ms | 1003 KiB | 14 Q