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_srand() == %d\n", $testseed, $r, $r); } ?>
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
mt_srand() == 17 mt_srand() == 18 mt_srand() == 19 mt_srand() == 20 mt_srand() == 21 mt_srand() == 22 mt_srand() == 23 mt_srand() == 24 mt_srand() == 25 mt_srand() == 26 mt_srand() == 27 mt_srand() == 28 mt_srand() == 29 mt_srand() == 30 mt_srand() == 31 mt_srand() == 32 mt_srand() == 33 mt_srand() == 34 mt_srand() == 35 mt_srand() == 36 mt_srand() == 37 mt_srand() == 38 mt_srand() == 39 mt_srand() == 40 mt_srand() == 41 mt_srand() == 42 mt_srand() == 43 mt_srand() == 44 mt_srand() == 45 mt_srand() == 46 mt_srand() == 47 mt_srand() == 48 mt_srand() == 49 mt_srand() == 50 mt_srand() == 51 mt_srand() == 52 mt_srand() == 53 mt_srand() == 54 mt_srand() == 55 mt_srand() == 56 mt_srand() == 57 mt_srand() == 58 mt_srand() == 59 mt_srand() == 60 mt_srand() == 61 mt_srand() == 62 mt_srand() == 63 mt_srand() == 64