3v4l.org

run code in 500+ PHP versions simultaneously
<?php $xml = <<< END <product> <ref>32332</ref> <name>Test 1</name> <features> <feature> <name>Feature 1</name> <value>Red</value> </feature> <feature> <name>Feature 2</name> <value>Large</value> </feature> </features> </product> END; $object = simplexml_load_string($xml); print_r(json_decode(json_encode($object), true));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R1hq7
function name:  (null)
number of ops:  16
compiled vars:  !0 = $xml, !1 = $object
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, '%3Cproduct%3E%0A+++%3Cref%3E32332%3C%2Fref%3E%0A+++%3Cname%3ETest+1%3C%2Fname%3E%0A+++%3Cfeatures%3E%0A+++++++%3Cfeature%3E%0A+++++++++++%3Cname%3EFeature+1%3C%2Fname%3E%0A+++++++++++%3Cvalue%3ERed%3C%2Fvalue%3E%0A+++++++%3C%2Ffeature%3E%0A+++++++%3Cfeature%3E%0A+++++++++++%3Cname%3EFeature+2%3C%2Fname%3E%0A+++++++++++%3Cvalue%3ELarge%3C%2Fvalue%3E%0A+++++++%3C%2Ffeature%3E%0A+++%3C%2Ffeatures%3E%0A%3C%2Fproduct%3E'
   20     1        INIT_FCALL                                                   'simplexml_load_string'
          2        SEND_VAR                                                     !0
          3        DO_ICALL                                             $3      
          4        ASSIGN                                                       !1, $3
   21     5        INIT_FCALL                                                   'print_r'
          6        INIT_FCALL                                                   'json_decode'
          7        INIT_FCALL                                                   'json_encode'
          8        SEND_VAR                                                     !1
          9        DO_ICALL                                             $5      
         10        SEND_VAR                                                     $5
         11        SEND_VAL                                                     <true>
         12        DO_ICALL                                             $6      
         13        SEND_VAR                                                     $6
         14        DO_ICALL                                                     
         15      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
164.23 ms | 2138 KiB | 17 Q