3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class X {} function test(int $number):X { return null; } echo test(123);
based on VlONO
Output for 7.0.0 - 7.3.0rc4
Fatal error: Uncaught TypeError: Return value of test() must be an instance of X, null returned in /in/8m8QG:5 Stack trace: #0 /in/8m8QG(8): test(123) #1 {main} thrown in /in/8m8QG on line 5
Process exited with code 255.
Output for 5.3.20 - 5.6.28
Parse error: syntax error, unexpected ':', expecting '{' in /in/8m8QG on line 4
Process exited with code 255.