3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $min = 17; $max = $min + 48; // 48 is to fit the results in my console for ($testseed=$min; $testseed<$max; $testseed++) { mt_srand( $testseed ); $r = mt_rand(); printf("mt_rand() == %d\n", $testseed, $r, $r); } ?>
Output for 4.3.0 - 7.1.0
mt_rand() == 17 mt_rand() == 18 mt_rand() == 19 mt_rand() == 20 mt_rand() == 21 mt_rand() == 22 mt_rand() == 23 mt_rand() == 24 mt_rand() == 25 mt_rand() == 26 mt_rand() == 27 mt_rand() == 28 mt_rand() == 29 mt_rand() == 30 mt_rand() == 31 mt_rand() == 32 mt_rand() == 33 mt_rand() == 34 mt_rand() == 35 mt_rand() == 36 mt_rand() == 37 mt_rand() == 38 mt_rand() == 39 mt_rand() == 40 mt_rand() == 41 mt_rand() == 42 mt_rand() == 43 mt_rand() == 44 mt_rand() == 45 mt_rand() == 46 mt_rand() == 47 mt_rand() == 48 mt_rand() == 49 mt_rand() == 50 mt_rand() == 51 mt_rand() == 52 mt_rand() == 53 mt_rand() == 54 mt_rand() == 55 mt_rand() == 56 mt_rand() == 57 mt_rand() == 58 mt_rand() == 59 mt_rand() == 60 mt_rand() == 61 mt_rand() == 62 mt_rand() == 63 mt_rand() == 64