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() == 8x%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_rand() == 8x17 mt_rand() == 8x18 mt_rand() == 8x19 mt_rand() == 8x20 mt_rand() == 8x21 mt_rand() == 8x22 mt_rand() == 8x23 mt_rand() == 8x24 mt_rand() == 8x25 mt_rand() == 8x26 mt_rand() == 8x27 mt_rand() == 8x28 mt_rand() == 8x29 mt_rand() == 8x30 mt_rand() == 8x31 mt_rand() == 8x32 mt_rand() == 8x33 mt_rand() == 8x34 mt_rand() == 8x35 mt_rand() == 8x36 mt_rand() == 8x37 mt_rand() == 8x38 mt_rand() == 8x39 mt_rand() == 8x40 mt_rand() == 8x41 mt_rand() == 8x42 mt_rand() == 8x43 mt_rand() == 8x44 mt_rand() == 8x45 mt_rand() == 8x46 mt_rand() == 8x47 mt_rand() == 8x48 mt_rand() == 8x49 mt_rand() == 8x50 mt_rand() == 8x51 mt_rand() == 8x52 mt_rand() == 8x53 mt_rand() == 8x54 mt_rand() == 8x55 mt_rand() == 8x56 mt_rand() == 8x57 mt_rand() == 8x58 mt_rand() == 8x59 mt_rand() == 8x60 mt_rand() == 8x61 mt_rand() == 8x62 mt_rand() == 8x63 mt_rand() == 8x64