3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = 0; for($i=1; $i<=200;$i++) { $rand = random_int(1, 200); if ($rand === 1) $a++; } echo $a;
based on Cf4eo
Output for hhvm-3.15.4, 7.0.0 - 7.0.1, 7.0.7, 7.0.9, 7.0.12, 7.0.17 - 7.0.19, 7.1.1, 7.1.4 - 7.1.6, 7.2.6
0
Output for 7.0.3, 7.0.20 - 7.1.0, 7.2.0
2
Output for 7.0.2, 7.0.4 - 7.0.6, 7.0.8, 7.0.10 - 7.0.11, 7.0.13, 7.0.15 - 7.0.16, 7.1.2 - 7.1.3, 7.1.7 - 7.1.10
1
Output for 7.0.14
3
Output for 5.6.0 - 5.6.30
Fatal error: Call to undefined function random_int() in /in/30caE on line 5
Process exited with code 255.