3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = '<?xml version="1.0" encoding="UTF-8"?> <versions> <version file="foo_1.0.0.xml" /> <version file="foo_1.0.1.xml" /> </versions>'; $simpleXml = simplexml_load_string($xml); foreach ($simpleXml->xpath('/versions/version[@file="foo_1.0.1.xml"]') as $element) { unset($element[0]); } echo $simpleXml->saveXML();
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 12
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 12
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/Z7cNd
function name:  (null)
number of ops:  17
compiled vars:  !0 = $xml, !1 = $simpleXml, !2 = $element
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%3Cversions%3E%0A++++%3Cversion+file%3D%22foo_1.0.0.xml%22+%2F%3E%0A++++%3Cversion+file%3D%22foo_1.0.1.xml%22+%2F%3E%0A%3C%2Fversions%3E'
    9     1        INIT_FCALL                                               'simplexml_load_string'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
   10     5        INIT_METHOD_CALL                                         !1, 'xpath'
          6        SEND_VAL_EX                                              '%2Fversions%2Fversion%5B%40file%3D%22foo_1.0.1.xml%22%5D'
          7        DO_FCALL                                      0  $6      
          8      > FE_RESET_R                                       $7      $6, ->12
          9    > > FE_FETCH_R                                               $7, !2, ->12
   11    10    >   UNSET_DIM                                                !2, 0
   10    11      > JMP                                                      ->9
         12    >   FE_FREE                                                  $7
   14    13        INIT_METHOD_CALL                                         !1, 'saveXML'
         14        DO_FCALL                                      0  $8      
         15        ECHO                                                     $8
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
213.16 ms | 1395 KiB | 15 Q