3v4l.org

run code in 300+ PHP versions simultaneously
<?php class P { public function &foo(): string {} } class C extends P { public function foo(): string {} }
Output for 8.2.0 - 8.2.28, 8.3.0 - 8.3.21, 8.4.1 - 8.4.7
Fatal error: Declaration of C::foo(): string must be compatible with & P::foo(): string in /in/2OmEj on line 8
Process exited with code 255.

preferences:
161.9 ms | 1000 KiB | 7 Q