3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = new stdClass; $arr = []; $arr[0] = "abc"; $arr[1] = "aaa"; $str = 'foo'; $abc = 'bar'; $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/DXNni
function name:  (null)
number of ops:  19
compiled vars:  !0 = $json, !1 = $arr, !2 = $str, !3 = $abc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   NEW                                              $4      'stdClass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $4
    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        ASSIGN                                                   !2, 'foo'
    7     9        ASSIGN                                                   !3, 'bar'
    8    10        FETCH_DIM_R                                      ~14     !1, 1
         11        FETCH_OBJ_W                                      $12     !0, !1
         12        ASSIGN_DIM                                               $12, 0
         13        OP_DATA                                                  ~14
   10    14        INIT_FCALL                                               'json_encode'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $15     
         17        ECHO                                                     $15
         18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
180.23 ms | 1394 KiB | 15 Q