3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{"1":"A"}'; $arrWorks = json_decode($json, true); var_dump($arrWorks, $arrWorks[1], $arrWorks['1']); echo "\n=================\n"; $arrDoesntWork = get_object_vars(json_decode($json)); var_dump($arrDoesntWork, $arrDoesntWork[1], $arrDoesntWork['1']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Y9JGC
function name:  (null)
number of ops:  29
compiled vars:  !0 = $json, !1 = $arrWorks, !2 = $arrDoesntWork
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%7B%221%22%3A%22A%22%7D'
    5     1        INIT_FCALL                                               'json_decode'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 <true>
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
    6     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        FETCH_DIM_R                                      ~6      !1, 1
          9        SEND_VAL                                                 ~6
         10        FETCH_DIM_R                                      ~7      !1, 1
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                                 
    8    13        ECHO                                                     '%0A%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A'
    9    14        INIT_FCALL                                               'get_object_vars'
         15        INIT_FCALL                                               'json_decode'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $9      
         18        SEND_VAR                                                 $9
         19        DO_ICALL                                         $10     
         20        ASSIGN                                                   !2, $10
   10    21        INIT_FCALL                                               'var_dump'
         22        SEND_VAR                                                 !2
         23        FETCH_DIM_R                                      ~12     !2, 1
         24        SEND_VAL                                                 ~12
         25        FETCH_DIM_R                                      ~13     !2, 1
         26        SEND_VAL                                                 ~13
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.25 ms | 1395 KiB | 19 Q