3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php mt_srand(1234); var_dump(mt_rand(100,1)); define("UL", mt_getrandmax()+1000); $r=mt_rand(0, UL); var_dump($r); if ($r < 0 || $r > UL) echo "Random value out of range\n";
based on OfNE4
Output for 7.1.0
Warning: mt_rand(): max(1) is smaller than min(100) in /in/TucCX on line 3 bool(false) int(822569775)
Output for 5.3.4 - 5.6.28, 7.0.0 - 7.0.14
Warning: mt_rand(): max(1) is smaller than min(100) in /in/TucCX on line 3 bool(false) int(1741177867)
Output for 5.2.1 - 5.3.3, hhvm-3.10.0 - 3.13.2
int(21) int(1068725082)
Output for 4.3.0 - 5.2.0
int(51) int(972963285)