3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = '<?xml version="1.0" encoding="UTF-8"?> <foo> <bar> <name>Frank</name> </bar> </foo>'; $xml = new SimpleXMLElement($str); $results = $xml->xpath("//foo/bar/name"); $first_result = $results[0]; var_dump( (string)$first_result ); var_dump( $first_result->asXML() );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/FV6kG
function name:  (null)
number of ops:  21
compiled vars:  !0 = $str, !1 = $xml, !2 = $results, !3 = $first_result
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%3C%3Fxml+version%3D%221.0%22+encoding%3D%22UTF-8%22%3F%3E%0A%3Cfoo%3E%0A+%3Cbar%3E%0A++%3Cname%3EFrank%3C%2Fname%3E%0A+%3C%2Fbar%3E%0A%3C%2Ffoo%3E'
   10     1        NEW                                              $5      'SimpleXMLElement'
          2        SEND_VAR_EX                                              !0
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $5
   11     5        INIT_METHOD_CALL                                         !1, 'xpath'
          6        SEND_VAL_EX                                              '%2F%2Ffoo%2Fbar%2Fname'
          7        DO_FCALL                                      0  $8      
          8        ASSIGN                                                   !2, $8
   12     9        FETCH_DIM_R                                      ~10     !2, 0
         10        ASSIGN                                                   !3, ~10
   14    11        INIT_FCALL                                               'var_dump'
         12        CAST                                          6  ~12     !3
         13        SEND_VAL                                                 ~12
         14        DO_ICALL                                                 
   15    15        INIT_FCALL                                               'var_dump'
         16        INIT_METHOD_CALL                                         !3, 'asXML'
         17        DO_FCALL                                      0  $14     
         18        SEND_VAR                                                 $14
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.23 ms | 1436 KiB | 14 Q