3v4l.org

run code in 300+ 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:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'b', 'a'
   11     1        NEW                                              $0      'B'
          2        DO_FCALL                                      0          
          3        FREE                                                     $0
   12     4      > 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.0.0


preferences:
123.3 ms | 1398 KiB | 13 Q