3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = <<<XML <a> <b> <c>text</c> <c>stuff</c> </b> <d> <c>code</c> </d> </a> XML; $xml = new SimpleXMLElement($string); $result = $xml->xpath('/a/b/c'); foreach ($result as $k => $v) echo $v . "\n"; while(list( , $node) = each($result)) { //echo '/a/b/c: ',$node,"\n"; //echo $node; } var_dump($result);
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 = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 23, Position 2 = 17
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
Branch analysis from position: 15
filename:       /in/0XYiF
function name:  (null)
number of ops:  27
compiled vars:  !0 = $string, !1 = $xml, !2 = $result, !3 = $v, !4 = $k, !5 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Ca%3E%0A+%3Cb%3E%0A++%3Cc%3Etext%3C%2Fc%3E%0A++%3Cc%3Estuff%3C%2Fc%3E%0A+%3C%2Fb%3E%0A+%3Cd%3E%0A++%3Cc%3Ecode%3C%2Fc%3E%0A+%3C%2Fd%3E%0A%3C%2Fa%3E'
   14     1        NEW                                              $7      'SimpleXMLElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $7
   17     5        INIT_METHOD_CALL                                         !1, 'xpath'
          6        SEND_VAL_EX                                              '%2Fa%2Fb%2Fc'
          7        DO_FCALL                                      0  $10     
          8        ASSIGN                                                   !2, $10
   19     9      > FE_RESET_R                                       $12     !2, ->15
         10    > > FE_FETCH_R                                       ~13     $12, !3, ->15
         11    >   ASSIGN                                                   !4, ~13
   20    12        CONCAT                                           ~15     !3, '%0A'
         13        ECHO                                                     ~15
   19    14      > JMP                                                      ->10
         15    >   FE_FREE                                                  $12
   23    16      > JMP                                                      ->17
         17    >   INIT_FCALL_BY_NAME                                       'each'
         18        SEND_VAR_EX                                              !2
         19        DO_FCALL                                      0  $16     
         20        FETCH_LIST_R                                     $17     $16, 1
         21        ASSIGN                                                   !5, $17
         22      > JMPNZ                                                    $16, ->17
   28    23    >   INIT_FCALL                                               'var_dump'
         24        SEND_VAR                                                 !2
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.57 ms | 1396 KiB | 18 Q