3v4l.org

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