3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A{ } class B extends A { } function GiveA () : A { return new B(); } print_r(GiveA());
Output for 7.0.28 - 7.3.0rc3
B Object ( )
Output for 5.6.38
Parse error: syntax error, unexpected ':', expecting '{' in /in/KMmKM on line 10
Process exited with code 255.