3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface BarInterface { } interface FooInterface { public function getBar(): BarInterface; } class Foo implements FooInterface { public function getBar() { return null; } } $foo = new Foo(); $foo->getBar();
based on m01S9
Output for 7.0.0 - 7.3.0rc3
Fatal error: Declaration of Foo::getBar() must be compatible with FooInterface::getBar(): BarInterface in /in/blFHr on line 9
Process exited with code 255.
Output for hhvm-3.15.4
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/blFHr on line 6
Process exited with code 255.