3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function test($bar = null) {} } class Baz extends Foo { public function test(...$args) {} }
Output for 5.6.0 - 5.6.30, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Output for 7.4.0 - 7.4.33
Warning: Declaration of Baz::test(...$args) should be compatible with Foo::test($bar = NULL) in /in/8oKKV on line 8
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33
Warning: Declaration of Baz::test(...$args) should be compatible with Foo::test($bar = NULL) in /in/8oKKV on line 9
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38
Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /in/8oKKV on line 8
Process exited with code 255.

preferences:
235.31 ms | 401 KiB | 283 Q