3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function bar($total = null) { } } class Baz extends Foo { public function bar() { } } (new Baz)->bar();
Output for 8.0.1 - 8.0.28, 8.1.0 - 8.1.17, 8.2.0 - 8.2.4
Fatal error: Declaration of Baz::bar() must be compatible with Foo::bar($total = null) in /in/rRJqH on line 13
Process exited with code 255.

preferences:
161.6 ms | 998 KiB | 7 Q