3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Baz { public function foo(string $param = null, int $bar); } class Foo { public function foo(string $param = null, int $bar) { var_dump($param, $bar); } } class Bar extends Foo implements Baz { public function foo(?string $param, int $bar) { parent::foo($param, $bar); } } (new Bar)->foo('a', 1); interface Qux { public function foo(?string $param, int $bar); } class Quux { public function foo(?string $param, int $bar) { var_dump($param, $bar); } } class Corge extends Quux implements Qux { public function foo(string $param = null, int $bar) { parent::foo($param, $bar); } } (new Corge)->foo('b', 2);

preferences:
80.64 ms | 404 KiB | 5 Q