3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface Shiter { public function foo(Shiter $shit); } class Bbk implements Shiter { public function foo(Shiter $shit): Shiter { return new self(); } } $bbk = new Bbk(); $result = $bbk->foo(new Bbk()); var_dump($result);
based on K0ckX
Output for 7.0.0 - 7.2.0
object(Bbk)#3 (0) { }
Output for 5.3.19 - 5.6.28
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/OpP23 on line 9
Process exited with code 255.