3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { function show() { return __CLASS__; } } $key = ''; $arr = array('' => new foo()); var_dump($arr, $key, $arr[$key]->show());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Fm0GZ
function name:  (null)
number of ops:  14
compiled vars:  !0 = $key, !1 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, ''
    8     1        NEW                                              $3      'foo'
          2        DO_FCALL                                      0          
          3        INIT_ARRAY                                       ~5      $3, ''
          4        ASSIGN                                                   !1, ~5
   10     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !1
          7        SEND_VAR                                                 !0
          8        FETCH_DIM_R                                      ~7      !1, !0
          9        INIT_METHOD_CALL                                         ~7, 'show'
         10        DO_FCALL                                      0  $8      
         11        SEND_VAR                                                 $8
         12        DO_ICALL                                                 
         13      > RETURN                                                   1

Class foo:
Function show:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Fm0GZ
function name:  show
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E > > RETURN                                                   'foo'
    5     1*     > RETURN                                                   null

End of function show

End of class foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
162.39 ms | 1395 KiB | 15 Q