3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<root> <parent name="Peter"> <child age="20">James</child> <child age="5">Leila</child> </parent> <parent name="Anna"> <child age="10">Dido</child> <child age="11">George</child> </parent> </root>'; $xmlElement = new SimpleXMLElement($xml); $teens = $xmlElement->xpath('//child[@age>9]'); print $teens[1];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4GrJA
function name:  (null)
number of ops:  12
compiled vars:  !0 = $xml, !1 = $xmlElement, !2 = $teens
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    1     0  E >   ASSIGN                                                   !0, '%3Croot%3E+%0A++%3Cparent+name%3D%22Peter%22%3E%0A++++%3Cchild+age%3D%2220%22%3EJames%3C%2Fchild%3E%0A++++%3Cchild+age%3D%225%22%3ELeila%3C%2Fchild%3E%0A++%3C%2Fparent%3E%0A++%3Cparent+name%3D%22Anna%22%3E%0A++++%3Cchild+age%3D%2210%22%3EDido%3C%2Fchild%3E%0A++++%3Cchild+age%3D%2211%22%3EGeorge%3C%2Fchild%3E%0A++%3C%2Fparent%3E%0A%3C%2Froot%3E'
   12     1        NEW                                              $4      'SimpleXMLElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $4
   13     5        INIT_METHOD_CALL                                         !1, 'xpath'
          6        SEND_VAL_EX                                              '%2F%2Fchild%5B%40age%3E9%5D'
          7        DO_FCALL                                      0  $7      
          8        ASSIGN                                                   !2, $7
   14     9        FETCH_DIM_R                                      ~9      !2, 1
         10        ECHO                                                     ~9
         11      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.05 ms | 1392 KiB | 13 Q