3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface foo { public function test($a); } class bar implements foo { public function test($a, $b) // invalid { } } class baz implements foo { public function test($a, $b = null) // valid { } }
based on 7cHUS
Output for 7.0.0 - 7.2.0
Fatal error: Declaration of bar::test($a, $b) must be compatible with foo::test($a) in /in/RW9lO on line 8
Process exited with code 255.
Output for 5.4.11 - 5.6.28
Fatal error: Declaration of bar::test() must be compatible with foo::test($a) in /in/RW9lO on line 9
Process exited with code 255.
Output for 5.3.21 - 5.3.29
Fatal error: Declaration of bar::test() must be compatible with that of foo::test() in /in/RW9lO on line 9
Process exited with code 255.