3v4l.org

run code in 300+ PHP versions simultaneously
<?php $actions = array( '*' => 'multiply', '/' => 'divide' ); function dontSwitch($option) { return call_user_func($actions[$option]); } function multiply() { return 'fuuuuu'; } function divide() { return 'dump'; } echo dontSwitch('*');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YBvBJ
function name:  (null)
number of ops:  6
compiled vars:  !0 = $actions
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   17     1        INIT_FCALL                                               'dontswitch'
          2        SEND_VAL                                                 '%2A'
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

Function dontswitch:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/YBvBJ
function name:  dontSwitch
number of ops:  6
compiled vars:  !0 = $option, !1 = $actions
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
    7     1        FETCH_DIM_R                                      ~2      !1, !0
          2        INIT_USER_CALL                                0          'call_user_func', ~2
          3        DO_FCALL                                      0  $3      
          4      > RETURN                                                   $3
    8     5*     > RETURN                                                   null

End of function dontswitch

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

End of function multiply

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

End of function divide

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.19 ms | 1398 KiB | 14 Q