3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function run() { print "RUN" . PHP_EOL; } } class B { public function executor(callable $callable) { call_user_func($callable); } } (new B())->executor([new A, 'run']);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Iv5P
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   NEW                                              $0      'B'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'executor'
          3        NEW                                              $2      'A'
          4        DO_FCALL                                      0          
          5        INIT_ARRAY                                       ~4      $2
          6        ADD_ARRAY_ELEMENT                                ~4      'run'
          7        SEND_VAL_EX                                              ~4
          8        DO_FCALL                                      0          
          9      > RETURN                                                   1

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

End of function run

End of class A.

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

End of function executor

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.87 ms | 1398 KiB | 13 Q