3v4l.org

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

Class User:
Function getname:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OVYAa
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:
141.53 ms | 1001 KiB | 14 Q