3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?hh interface Foo { public function bar(): string; } class Test implements Foo { public function bar() { return new StdClass; } } $t = new Test; var_dump($t->bar());
Output for hhvm-3.10.0 - 3.12.0
object(stdClass)#2 (0) { }
Output for 5.3.0 - 5.4.32
<?hh interface Foo { public function bar(): string; } class Test implements Foo { public function bar() { return new StdClass; } } $t = new Test; var_dump($t->bar());