3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface IRole { } interface Foo { public function bar(IRole $role = null); } class Bat implements Foo { public function bar($role = null) { echo "test"; } }
based on r1oGq
Output for 7.2.0
Output for 7.1.0 - 7.1.10
Fatal error: Declaration of Bat::bar($role = NULL) must be compatible with Foo::bar(?IRole $role = NULL) in /in/U3WZ2 on line 11
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Fatal error: Declaration of Bat::bar($role = NULL) must be compatible with Foo::bar(IRole $role = NULL) in /in/U3WZ2 on line 11
Process exited with code 255.
Output for 5.4.1 - 5.6.28
Fatal error: Declaration of Bat::bar() must be compatible with Foo::bar(IRole $role = NULL) in /in/U3WZ2 on line 11
Process exited with code 255.
Output for 5.3.18 - 5.3.29
Fatal error: Declaration of Bat::bar() must be compatible with that of Foo::bar() in /in/U3WZ2 on line 11
Process exited with code 255.