3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xml = new SimpleXMLElement('<root><elements attr="test"><el>test1</el><el>test2</el><el test_attr="123">test3</el></elements></root>'); print_r(json_decode(json_encode((array) simplexml_load_string($xml)), 1));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CUIXW
function name:  (null)
number of ops:  19
compiled vars:  !0 = $xml
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $1      'SimpleXMLElement'
          1        SEND_VAL_EX                                              '%3Croot%3E%3Celements+attr%3D%22test%22%3E%3Cel%3Etest1%3C%2Fel%3E%3Cel%3Etest2%3C%2Fel%3E%3Cel+test_attr%3D%22123%22%3Etest3%3C%2Fel%3E%3C%2Felements%3E%3C%2Froot%3E'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
    4     4        INIT_FCALL                                               'print_r'
          5        INIT_FCALL                                               'json_decode'
          6        INIT_FCALL                                               'json_encode'
          7        INIT_FCALL                                               'simplexml_load_string'
          8        SEND_VAR                                                 !0
          9        DO_ICALL                                         $4      
         10        CAST                                          7  ~5      $4
         11        SEND_VAL                                                 ~5
         12        DO_ICALL                                         $6      
         13        SEND_VAR                                                 $6
         14        SEND_VAL                                                 1
         15        DO_ICALL                                         $7      
         16        SEND_VAR                                                 $7
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.03 ms | 1395 KiB | 21 Q