3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Test{ function function1():int{ return 'dick'; } } $test = new Test(); echo $test->function1();
based on tmS7K
Output for 7.0.0 - 7.2.0
Fatal error: Uncaught TypeError: Return value of Test::function1() must be of the type integer, string returned in /in/dTdIX:6 Stack trace: #0 /in/dTdIX(12): Test->function1() #1 {main} thrown in /in/dTdIX on line 6
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /in/dTdIX on line 5
Process exited with code 255.