3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x=new stdClass(); $y='1002'; $x->$y = ''; var_dump(key(array(1002=>'')), key((array)$x));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/blt2W
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                                                   !1, '1002'
    5     4        ASSIGN_OBJ                                               !0, !1
          5        OP_DATA                                                  ''
    7     6        INIT_FCALL                                               'var_dump'
          7        INIT_FCALL                                               'key'
          8        SEND_VAL                                                 <array>
          9        DO_ICALL                                         $7      
         10        SEND_VAR                                                 $7
         11        INIT_FCALL                                               'key'
         12        CAST                                          7  ~8      !0
         13        SEND_VAL                                                 ~8
         14        DO_ICALL                                         $9      
         15        SEND_VAR                                                 $9
         16        DO_ICALL                                                 
         17      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.59 ms | 1386 KiB | 17 Q