3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A {} interface SomeInterface { public function test() : A; } class B implements SomeInterface { public function test() : A // all good! { return null; // Fatal error: Uncaught TypeError: Return value of B::test() must be an instance of A, null returned... } } ?>
Output for 7.0.0 - 7.2.0
Output for 5.3.21 - 5.6.28
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/5SH2o on line 7
Process exited with code 255.