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() == 0x%08x\n", $testseed, $r, $r); } ?>
Output for 4.3.0 - 7.1.0
mt_rand() == 0x00000011 mt_rand() == 0x00000012 mt_rand() == 0x00000013 mt_rand() == 0x00000014 mt_rand() == 0x00000015 mt_rand() == 0x00000016 mt_rand() == 0x00000017 mt_rand() == 0x00000018 mt_rand() == 0x00000019 mt_rand() == 0x0000001a mt_rand() == 0x0000001b mt_rand() == 0x0000001c mt_rand() == 0x0000001d mt_rand() == 0x0000001e mt_rand() == 0x0000001f mt_rand() == 0x00000020 mt_rand() == 0x00000021 mt_rand() == 0x00000022 mt_rand() == 0x00000023 mt_rand() == 0x00000024 mt_rand() == 0x00000025 mt_rand() == 0x00000026 mt_rand() == 0x00000027 mt_rand() == 0x00000028 mt_rand() == 0x00000029 mt_rand() == 0x0000002a mt_rand() == 0x0000002b mt_rand() == 0x0000002c mt_rand() == 0x0000002d mt_rand() == 0x0000002e mt_rand() == 0x0000002f mt_rand() == 0x00000030 mt_rand() == 0x00000031 mt_rand() == 0x00000032 mt_rand() == 0x00000033 mt_rand() == 0x00000034 mt_rand() == 0x00000035 mt_rand() == 0x00000036 mt_rand() == 0x00000037 mt_rand() == 0x00000038 mt_rand() == 0x00000039 mt_rand() == 0x0000003a mt_rand() == 0x0000003b mt_rand() == 0x0000003c mt_rand() == 0x0000003d mt_rand() == 0x0000003e mt_rand() == 0x0000003f mt_rand() == 0x00000040