3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php abstract class Foo{ abstract public function bar(array $params = null); } class Moo extends Foo{ public function bar(array $params){ echo count($params); } } $c = new Moo(); $c->bar(array(5));
based on uvaLq
Output for 7.0.0 - 7.0.1
Fatal error: Declaration of Moo::bar(array $params) must be compatible with Foo::bar(array $params = NULL) in /in/DHV8X on line 11
Process exited with code 255.
Output for 5.4.11 - 5.6.16
Fatal error: Declaration of Moo::bar() must be compatible with Foo::bar(array $params = NULL) in /in/DHV8X on line 11
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Fatal error: Declaration of Moo::bar() must be compatible with that of Foo::bar() in /in/DHV8X on line 11
Process exited with code 255.