3v4l.org

run code in 300+ PHP versions simultaneously
<?php function taskRunner(Callable $param) { return call_user_func($param); } class Test { function __invoke() { print "Called".PHP_EOL; } } print call_user_func_array('isEven',array(3)); $b=new Test(); print taskRunner($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fkt4n
function name:  (null)
number of ops:  13
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_USER_CALL                                0          'call_user_func_array', 'isEven'
          1        SEND_ARRAY                                               <array>
          2        CHECK_UNDEF_ARGS                                         
          3        DO_FCALL                                      0  $1      
          4        ECHO                                                     $1
   15     5        NEW                                              $2      'Test'
          6        DO_FCALL                                      0          
          7        ASSIGN                                                   !0, $2
   16     8        INIT_FCALL                                               'taskrunner'
          9        SEND_VAR                                                 !0
         10        DO_FCALL                                      0  $5      
         11        ECHO                                                     $5
         12      > RETURN                                                   1

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

End of function taskrunner

Class Test:
Function __invoke:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fkt4n
function name:  __invoke
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   ECHO                                                     'Called%0A'
   11     1      > RETURN                                                   null

End of function __invoke

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.75 ms | 1398 KiB | 14 Q