3v4l.org

run code in 300+ PHP versions simultaneously
<?php $tmp_array = json_decode('{}'); $cid = "m"; $item = "Dhalia"; $cost = "10"; $tmp_array->$cid->$item = $cost; var_dump($tmp_array); $tmp_array = json_encode($tmp_array); echo $tmp_array;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fXmJk
function name:  (null)
number of ops:  19
compiled vars:  !0 = $tmp_array, !1 = $cid, !2 = $item, !3 = $cost
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'json_decode'
          1        SEND_VAL                                                 '%7B%7D'
          2        DO_ICALL                                         $4      
          3        ASSIGN                                                   !0, $4
    4     4        ASSIGN                                                   !1, 'm'
    5     5        ASSIGN                                                   !2, 'Dhalia'
    6     6        ASSIGN                                                   !3, '10'
    7     7        FETCH_OBJ_W                                      $9      !0, !1
          8        ASSIGN_OBJ                                               $9, !2
          9        OP_DATA                                                  !3
    8    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !0
         12        DO_ICALL                                                 
    9    13        INIT_FCALL                                               'json_encode'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                         $12     
         16        ASSIGN                                                   !0, $12
   10    17        ECHO                                                     !0
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
195.91 ms | 1386 KiB | 19 Q