3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A { public function run(): mixed { return null; } } class B extends A { public function run(): string { return 'test'; } } echo (new B())->run();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NcBW6
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   NEW                                              $0      'B'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'run'
          3        DO_FCALL                                      0  $2      
          4        ECHO                                                     $2
          5      > RETURN                                                   1

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

End of function run

End of class A.

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

End of function run

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.04 ms | 1404 KiB | 13 Q