3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface Bar {} interface Baz extends Bar {}; interface Foo { public function art(Bar $bar); } interface Fooz extends Foo { } class A implements Fooz { public function art(Baz $bar) { var_dump($bar); } }
based on jSWX9
Output for 7.0.0 - 7.2.0
Fatal error: Declaration of A::art(Baz $bar) must be compatible with Foo::art(Bar $bar) in /in/TmEPQ on line 9
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Declaration of A::art() must be compatible with Foo::art(Bar $bar) in /in/TmEPQ on line 9
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Fatal error: Declaration of A::art() must be compatible with that of Foo::art() in /in/TmEPQ on line 9
Process exited with code 255.