3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function xx(): string { return 'x'; } } class Bar extends Foo { public function xx() { return 'yy'; } } echo (new Bar())->xx();
Output for 7.1.0 - 7.1.19, 7.2.0 - 7.2.8
Fatal error: Declaration of Bar::xx() must be compatible with Foo::xx(): string in /in/LOOiv on line 16
Process exited with code 255.

preferences:
144.88 ms | 998 KiB | 7 Q