3v4l.org

run code in 500+ PHP versions simultaneously
<?php $xmlStr = '<root><node> <child1></child1> <findme>first</findme> <child2></child2> </node> <node> <child1> <findme>second</findme> </child1> <child2></child2> </node> <node> <child1></child1> <child2> <another> <findme>third</findme> </another> </child2> </node></root>'; $xml = new SimpleXMLElement($xmlStr); $result = $xml->xpath('//findme'); foreach($result as $elem) { echo $elem."\r"; } ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 14
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 14
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 14
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/WsMvi
function name:  (null)
number of ops:  16
compiled vars:  !0 = $xmlStr, !1 = $xml, !2 = $result, !3 = $elem
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, '%3Croot%3E%3Cnode%3E%0A++++%3Cchild1%3E%3C%2Fchild1%3E%0A++++%3Cfindme%3Efirst%3C%2Ffindme%3E%0A++++%3Cchild2%3E%3C%2Fchild2%3E%0A%3C%2Fnode%3E%0A%3Cnode%3E%0A++++%3Cchild1%3E%0A++++++++%3Cfindme%3Esecond%3C%2Ffindme%3E%0A++++%3C%2Fchild1%3E%0A++++%3Cchild2%3E%3C%2Fchild2%3E%0A%3C%2Fnode%3E%0A%3Cnode%3E%0A++++%3Cchild1%3E%3C%2Fchild1%3E%0A++++%3Cchild2%3E%0A++++++%3Canother%3E%0A++++++++++++%3Cfindme%3Ethird%3C%2Ffindme%3E%0A++++++%3C%2Fanother%3E%0A++++%3C%2Fchild2%3E%0A%3C%2Fnode%3E%3C%2Froot%3E'
   22     1        NEW                                                  $5      'SimpleXMLElement'
          2        SEND_VAR_EX                                                  !0
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !1, $5
   23     5        INIT_METHOD_CALL                                             !1, 'xpath'
          6        SEND_VAL_EX                                                  '%2F%2Ffindme'
          7        DO_FCALL                                          0  $8      
          8        ASSIGN                                                       !2, $8
   25     9      > FE_RESET_R                                           $10     !2, ->14
         10    > > FE_FETCH_R                                                   $10, !3, ->14
   27    11    >   CONCAT                                               ~11     !3, '%0D'
         12        ECHO                                                         ~11
   25    13      > JMP                                                          ->10
         14    >   FE_FREE                                                      $10
   30    15      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
199.27 ms | 2580 KiB | 13 Q