3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.5 ms | 1393 KiB | 13 Q