3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = "<root> <parent> <child name='Child1' /> <child name='Child2' /> <subparent> <child name='Child3' /> </subparent> </parent> <child name='Child4' /> </root>"; $xml = simplexml_load_string( $xml); $node= $xml->xpath( '//child[@name="Child2"]'); echo $node[0];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/lQOLT
function name:  (null)
number of ops:  12
compiled vars:  !0 = $xml, !1 = $node
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%3Croot%3E%0A++++%3Cparent%3E%0A++++++++%3Cchild+name%3D%27Child1%27+%2F%3E%0A++++++++%3Cchild+name%3D%27Child2%27+%2F%3E%0A++++++++%3Csubparent%3E%0A++++++++++++%3Cchild+name%3D%27Child3%27+%2F%3E%0A++++++++%3C%2Fsubparent%3E%0A++++%3C%2Fparent%3E%0A++++%3Cchild+name%3D%27Child4%27+%2F%3E%0A%3C%2Froot%3E'
   13     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !0, $3
   15     5        INIT_METHOD_CALL                                         !0, 'xpath'
          6        SEND_VAL_EX                                              '%2F%2Fchild%5B%40name%3D%22Child2%22%5D'
          7        DO_FCALL                                      0  $5      
          8        ASSIGN                                                   !1, $5
   16     9        FETCH_DIM_R                                      ~7      !1, 0
         10        ECHO                                                     ~7
         11      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
151.16 ms | 1394 KiB | 15 Q