3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A {} function getA() : A { return null; } getA();
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Return value of getA() must be an instance of A, null returned in /in/eloAY:7 Stack trace: #0 /in/eloAY(10): getA() #1 {main} thrown in /in/eloAY on line 7
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Parse error: syntax error, unexpected ':', expecting '{' in /in/eloAY on line 5
Process exited with code 255.