3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Base { public function myMethod():SomeClass { } } class Subclass extends Base { public function myMethod() { } } class SomeClass {}
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.16, 8.3.0 - 8.3.3
Fatal error: Declaration of Subclass::myMethod() must be compatible with Base::myMethod(): SomeClass in /in/I5bh6 on line 10
Process exited with code 255.

preferences:
160.13 ms | 1458 KiB | 7 Q