3v4l.org

run code in 500+ PHP versions simultaneously
<?php class ParentReturn {} class ChildReturn {} class ParentClass { /** @return ParentReturn */ public function overridable() { return new ParentReturn(); } //public function nonOverridable(): ParentReturn { return new ParentReturn(); } } class ChildClass extends ParentClass { public function overridable(): ChildReturn { return new ChildReturn(); } //public function nonOverridable(): ChildReturn {return new ChildReturn();} }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aVgmG
function name:  (null)
number of ops:  1
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   17     0  E > > RETURN                                                       1

Class ParentReturn: [no user functions]
Class ChildReturn: [no user functions]
Class ParentClass:
Function overridable:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/aVgmG
function name:  overridable
number of ops:  4
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   NEW                                                  $0      'ParentReturn'
          1        DO_FCALL                                          0          
          2      > RETURN                                                       $0
          3*     > RETURN                                                       null

End of function overridable

End of class ParentClass.

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

End of function overridable

End of class ChildClass.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
158.34 ms | 2200 KiB | 13 Q