3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User { public function getName() { return "SomeName"; } } $result = [ 'command' => 'getName()' ]; $user = new User(); echo $user->{${$result['command']}};
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Cbdt4
function name:  (null)
number of ops:  9
compiled vars:  !0 = $result, !1 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN                                                   !0, <array>
   15     1        NEW                                              $3      'User'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
   16     4        FETCH_DIM_R                                      ~6      !0, 'command'
          5        FETCH_R                      local               ~7      ~6
          6        FETCH_OBJ_R                                      ~8      !1, ~7
          7        ECHO                                                     ~8
          8      > RETURN                                                   1

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

End of function getname

End of class User.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.53 ms | 1393 KiB | 13 Q