3v4l.org

run code in 500+ PHP versions simultaneously
<?php class A { public function foo(): mixed { return null; } } class B extends A { public function foo(): C { return new C; } } new B;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uc6TM
function name:  (null)
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   NEW                                                  $0      'B'
          1        DO_FCALL                                          0          
          2        FREE                                                         $0
   12     3      > RETURN                                                       1

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

End of function foo

End of class A.

Class B:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Uc6TM
function name:  foo
number of ops:  6
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   NEW                                                  $0      'C'
          1        DO_FCALL                                          0          
          2        VERIFY_RETURN_TYPE                                           $0
          3      > RETURN                                                       $0
          4*       VERIFY_RETURN_TYPE                                           
          5*     > RETURN                                                       null

End of function foo

End of class B.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
206.17 ms | 2008 KiB | 13 Q