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; } } $b=new Test(); print taskRunner($b);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rVhr9
function name:  (null)
number of ops:  8
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   NEW                                              $1      'Test'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   15     3        INIT_FCALL                                               'taskrunner'
          4        SEND_VAR                                                 !0
          5        DO_FCALL                                      0  $4      
          6        ECHO                                                     $4
          7      > RETURN                                                   1

Function taskrunner:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/rVhr9
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/rVhr9
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:
154.84 ms | 1397 KiB | 14 Q