3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "0" : "test1" }'; // just decode that into an object $obj = json_decode($json); // recast it into an array $array = (array) $obj; // just dump to see the results var_dump($obj, $array, $array[(string) 0], $array[0]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Kiv0D
function name:  (null)
number of ops:  17
compiled vars:  !0 = $json, !1 = $obj, !2 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%7B+%220%22+%3A+%22test1%22+%7D'
    4     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
    6     5        CAST                                          7  ~6      !1
          6        ASSIGN                                                   !2, ~6
    8     7        INIT_FCALL                                               'var_dump'
          8        SEND_VAR                                                 !1
          9        SEND_VAR                                                 !2
         10        CAST                                          6  ~8      0
         11        FETCH_DIM_R                                      ~9      !2, ~8
         12        SEND_VAL                                                 ~9
         13        FETCH_DIM_R                                      ~10     !2, 0
         14        SEND_VAL                                                 ~10
         15        DO_ICALL                                                 
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.12 ms | 1394 KiB | 17 Q