3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.94 ms | 1394 KiB | 15 Q