3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "0" : "test1" }'; $obj = json_decode($json); var_dump($obj); $array = (array) $obj; var_dump($array); echo $array['0'], ' ', $array[0];
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/1eU8s
function name:  (null)
number of ops:  19
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'
    3     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $4      
          4        ASSIGN                                                   !1, $4
    4     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        DO_ICALL                                                 
    5     8        CAST                                          7  ~7      !1
          9        ASSIGN                                                   !2, ~7
    6    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !2
         12        DO_ICALL                                                 
    7    13        FETCH_DIM_R                                      ~10     !2, 0
         14        ECHO                                                     ~10
         15        ECHO                                                     '+'
         16        FETCH_DIM_R                                      ~11     !2, 0
         17        ECHO                                                     ~11
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.12 ms | 1394 KiB | 17 Q