3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function foo():int { return rand(1, 10); } var_dump(foo());
Output for hhvm-3.15.4, 7.0.14 - 7.0.16, 7.2.6
int(1)
Output for 7.0.4, 7.1.0, 7.1.5, 7.2.0
int(10)
Output for 7.0.3, 7.0.10, 7.0.12, 7.0.18 - 7.0.19, 7.1.3, 7.1.10
int(7)
Output for 7.0.6, 7.1.4, 7.1.7
int(3)
Output for 7.0.7, 7.0.9, 7.1.1, 7.1.6
int(2)
Output for 7.0.1, 7.0.5, 7.1.2
int(5)
Output for 7.0.20
int(6)
Output for 7.0.0, 7.0.2, 7.0.8, 7.0.11, 7.0.17
int(9)
Output for 7.0.13
int(8)
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected ':', expecting '{' in /in/3cWUX on line 3
Process exited with code 255.