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); /* Search for <a><b><c> */ $result = $xml->xpath('/a/b/c'); while(list( , $node) = each($result)) { echo '/a/b/c: ',$node,"\n"; } /* Relative paths also work... */ $result = $xml->xpath('b/c'); 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 = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 24
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 24
Branch analysis from position: 33
Branch analysis from position: 24
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/5Mu2P
function name:  (null)
number of ops:  34
compiled vars:  !0 = $string, !1 = $xml, !2 = $result, !3 = $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                                              $5      'SimpleXMLElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $5
   17     5        INIT_METHOD_CALL                                         !1, 'xpath'
          6        SEND_VAL_EX                                              '%2Fa%2Fb%2Fc'
          7        DO_FCALL                                      0  $8      
          8        ASSIGN                                                   !2, $8
   19     9      > JMP                                                      ->13
   20    10    >   ECHO                                                     '%2Fa%2Fb%2Fc%3A+'
         11        ECHO                                                     !3
         12        ECHO                                                     '%0A'
   19    13    >   INIT_FCALL_BY_NAME                                       'each'
         14        SEND_VAR_EX                                              !2
         15        DO_FCALL                                      0  $10     
         16        FETCH_LIST_R                                     $11     $10, 1
         17        ASSIGN                                                   !3, $11
         18      > JMPNZ                                                    $10, ->10
   24    19    >   INIT_METHOD_CALL                                         !1, 'xpath'
         20        SEND_VAL_EX                                              'b%2Fc'
         21        DO_FCALL                                      0  $13     
         22        ASSIGN                                                   !2, $13
   26    23      > JMP                                                      ->27
   27    24    >   ECHO                                                     'b%2Fc%3A+'
         25        ECHO                                                     !3
         26        ECHO                                                     '%0A'
   26    27    >   INIT_FCALL_BY_NAME                                       'each'
         28        SEND_VAR_EX                                              !2
         29        DO_FCALL                                      0  $15     
         30        FETCH_LIST_R                                     $16     $15, 1
         31        ASSIGN                                                   !3, $16
         32      > JMPNZ                                                    $15, ->24
   28    33    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.1 ms | 1395 KiB | 16 Q