3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface HasMethodReturnIntOrString { public function methodA(): int|string; } interface HasMethodReturnIntOrFloat { public function methodA(): int|float; } // Fatal error: Declaration of HasMethodReturnIntOrString::methodA(): string|int must be compatible with HasMethodReturnIntOrFloat::methodA(): int|float in /in/IUQBd on line 5 interface HasMethodReturnInt extends HasMethodReturnIntOrString, HasMethodReturnIntOrFloat { }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ODQds
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   DECLARE_CLASS                                            'hasmethodreturnint'
   14     1      > RETURN                                                   1

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

End of function methoda

End of class HasMethodReturnIntOrString.

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

End of function methoda

End of class HasMethodReturnIntOrFloat.

Class HasMethodReturnInt: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.04 ms | 1432 KiB | 13 Q