3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php interface Test { public function check(Test $x); } //this is ok: class Foo implements Test { public function check(Test $x) {} } class Bar implements Test { public function check(Foo $x) {}; } //this is fail, but why? Bar implements Test, so.. logically it fulfills contract.. class Baz implements Test { public function check(Baz $x) {} }
Output for 5.4.0 - 5.4.28
Parse error: syntax error, unexpected ';', expecting function (T_FUNCTION) in /in/8UPGo on line 16
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /in/8UPGo on line 16
Process exited with code 255.