3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class A { abstract function lol(...$args); } class B extends A { function lol(bool $a, string $c) : array{ var_dump("asddsa"); return []; } } var_dump((new B())->lol(true, "asd"));
Output for 7.0.0 - 7.1.7
Fatal error: Declaration of B::lol(bool $a, string $c): array must be compatible with A::lol(...$args) in /in/SscP9 on line 12
Process exited with code 255.
Output for hhvm-3.15.4
Fatal error: Uncaught Error: Declaration of B::lol() must be compatible with that of A::lol() in /in/SscP9:7 Stack trace: #0 {main}
Process exited with code 255.
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/SscP9 on line 8
Process exited with code 255.