3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = new stdClass(); $arr = []; $arr[0] = "abc"; $arr[1] = "aaa"; $json->$arr[0] = $arr[1]; echo json_encode($json);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MT955
function name:  (null)
number of ops:  17
compiled vars:  !0 = $json, !1 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $2      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
    3     3        ASSIGN                                                   !1, <array>
    4     4        ASSIGN_DIM                                               !1, 0
          5        OP_DATA                                                  'abc'
    5     6        ASSIGN_DIM                                               !1, 1
          7        OP_DATA                                                  'aaa'
    6     8        FETCH_DIM_R                                      ~10     !1, 1
          9        FETCH_OBJ_W                                      $8      !0, !1
         10        ASSIGN_DIM                                               $8, 0
         11        OP_DATA                                                  ~10
    8    12        INIT_FCALL                                               'json_encode'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $11     
         15        ECHO                                                     $11
         16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.69 ms | 1394 KiB | 15 Q