3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = simplexml_load_string('<doc><str name="author">Bob</str></doc>'); $result = $xml->xpath("/doc/str[@name='author']")[0]; var_dump($result->asXML());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fugqu
function name:  (null)
number of ops:  15
compiled vars:  !0 = $xml, !1 = $result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'simplexml_load_string'
          1        SEND_VAL                                                 '%3Cdoc%3E%3Cstr+name%3D%22author%22%3EBob%3C%2Fstr%3E%3C%2Fdoc%3E'
          2        DO_ICALL                                         $2      
          3        ASSIGN                                                   !0, $2
    4     4        INIT_METHOD_CALL                                         !0, 'xpath'
          5        SEND_VAL_EX                                              '%2Fdoc%2Fstr%5B%40name%3D%27author%27%5D'
          6        DO_FCALL                                      0  $4      
          7        FETCH_DIM_R                                      ~5      $4, 0
          8        ASSIGN                                                   !1, ~5
    5     9        INIT_FCALL                                               'var_dump'
         10        INIT_METHOD_CALL                                         !1, 'asXML'
         11        DO_FCALL                                      0  $7      
         12        SEND_VAR                                                 $7
         13        DO_ICALL                                                 
         14      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.66 ms | 1385 KiB | 17 Q