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 == %d\n", $testseed, $r, $r); } ?>
Output for 7.1.0
mt_rand() == 0x00000011 == 632788279 mt_rand() == 0x00000012 == 1396668053 mt_rand() == 0x00000013 == 209451822 mt_rand() == 0x00000014 == 1263001265 mt_rand() == 0x00000015 == 104635876 mt_rand() == 0x00000016 == 447665594 mt_rand() == 0x00000017 == 1110888745 mt_rand() == 0x00000018 == 2061621457 mt_rand() == 0x00000019 == 1868577346 mt_rand() == 0x0000001a == 661285274 mt_rand() == 0x0000001b == 914229769 mt_rand() == 0x0000001c == 1565545088 mt_rand() == 0x0000001d == 1854910442 mt_rand() == 0x0000001e == 1383287698 mt_rand() == 0x0000001f == 614295913 mt_rand() == 0x00000020 == 1844450667 mt_rand() == 0x00000021 == 533671434 mt_rand() == 0x00000022 == 82810576 mt_rand() == 0x00000023 == 983665508 mt_rand() == 0x00000024 == 1564457282 mt_rand() == 0x00000025 == 2028291015 mt_rand() == 0x00000026 == 826293968 mt_rand() == 0x00000027 == 1174435524 mt_rand() == 0x00000028 == 875501219 mt_rand() == 0x00000029 == 538854368 mt_rand() == 0x0000002a == 804318771 mt_rand() == 0x0000002b == 247077794 mt_rand() == 0x0000002c == 1792809866 mt_rand() == 0x0000002d == 2123886053 mt_rand() == 0x0000002e == 1683267166 mt_rand() == 0x0000002f == 243714627 mt_rand() == 0x00000030 == 37560064 mt_rand() == 0x00000031 == 646316245 mt_rand() == 0x00000032 == 1062148952 mt_rand() == 0x00000033 == 1451122175 mt_rand() == 0x00000034 == 1767615994 mt_rand() == 0x00000035 == 1818193676 mt_rand() == 0x00000036 == 902336055 mt_rand() == 0x00000037 == 199948518 mt_rand() == 0x00000038 == 2113535914 mt_rand() == 0x00000039 == 187581927 mt_rand() == 0x0000003a == 784058257 mt_rand() == 0x0000003b == 1984350296 mt_rand() == 0x0000003c == 646120550 mt_rand() == 0x0000003d == 1770534705 mt_rand() == 0x0000003e == 72487689 mt_rand() == 0x0000003f == 1189579286 mt_rand() == 0x00000040 == 814107874
Output for 5.2.1 - 7.0.14
mt_rand() == 0x00000011 == 1526489153 mt_rand() == 0x00000012 == 745833443 mt_rand() == 0x00000013 == 1932529240 mt_rand() == 0x00000014 == 873212871 mt_rand() == 0x00000015 == 2037868690 mt_rand() == 0x00000016 == 1709514956 mt_rand() == 0x00000017 == 1031611487 mt_rand() == 0x00000018 == 95038887 mt_rand() == 0x00000019 == 271306548 mt_rand() == 0x0000001a == 1478597868 mt_rand() == 0x0000001b == 1228275583 mt_rand() == 0x0000001c == 572237814 mt_rand() == 0x0000001d == 298080924 mt_rand() == 0x0000001e == 758693604 mt_rand() == 0x0000001f == 1540791327 mt_rand() == 0x00000020 == 314302493 mt_rand() == 0x00000021 == 1619319676 mt_rand() == 0x00000022 == 2074370982 mt_rand() == 0x00000023 == 1172995602 mt_rand() == 0x00000024 == 578047028 mt_rand() == 0x00000025 == 128890545 mt_rand() == 0x00000026 == 1309395878 mt_rand() == 0x00000027 == 961250226 mt_rand() == 0x00000028 == 1264903125 mt_rand() == 0x00000029 == 1599452822 mt_rand() == 0x0000002a == 1354439493 mt_rand() == 0x0000002b == 1911680724 mt_rand() == 0x0000002c == 362278652 mt_rand() == 0x0000002d == 31201427 mt_rand() == 0x0000002e == 455043880 mt_rand() == 0x0000002f == 1909276469 mt_rand() == 0x00000030 == 2104945270 mt_rand() == 0x00000031 == 1506669987 mt_rand() == 0x00000032 == 1074064942 mt_rand() == 0x00000033 == 691382409 mt_rand() == 0x00000034 == 370169996 mt_rand() == 0x00000035 == 320117370 mt_rand() == 0x00000036 == 1250130753 mt_rand() == 0x00000037 == 1956711824 mt_rand() == 0x00000038 == 45222620 mt_rand() == 0x00000039 == 1952821393 mt_rand() == 0x0000003a == 1374696167 mt_rand() == 0x0000003b == 151862574 mt_rand() == 0x0000003c == 1506341136 mt_rand() == 0x0000003d == 381928007 mt_rand() == 0x0000003e == 2065294975 mt_rand() == 0x0000003f == 967606112 mt_rand() == 0x00000040 == 1338882452
Output for 4.3.0 - 5.2.0
mt_rand() == 0x00000011 == 416543883 mt_rand() == 0x00000012 == 1563109322 mt_rand() == 0x00000013 == 1563109322 mt_rand() == 0x00000014 == 1722492715 mt_rand() == 0x00000015 == 1722492715 mt_rand() == 0x00000016 == 324013731 mt_rand() == 0x00000017 == 324013731 mt_rand() == 0x00000018 == 1494098308 mt_rand() == 0x00000019 == 1494098308 mt_rand() == 0x0000001a == 1710099468 mt_rand() == 0x0000001b == 1710099468 mt_rand() == 0x0000001c == 946042951 mt_rand() == 0x0000001d == 946042951 mt_rand() == 0x0000001e == 697841096 mt_rand() == 0x0000001f == 697841096 mt_rand() == 0x00000020 == 1471289099 mt_rand() == 0x00000021 == 1471289099 mt_rand() == 0x00000022 == 848264191 mt_rand() == 0x00000023 == 848264191 mt_rand() == 0x00000024 == 1423108845 mt_rand() == 0x00000025 == 1423108845 mt_rand() == 0x00000026 == 2040034561 mt_rand() == 0x00000027 == 2040034561 mt_rand() == 0x00000028 == 2136803592 mt_rand() == 0x00000029 == 2136803592 mt_rand() == 0x0000002a == 1387371436 mt_rand() == 0x0000002b == 1387371436 mt_rand() == 0x0000002c == 1401763010 mt_rand() == 0x0000002d == 1401763010 mt_rand() == 0x0000002e == 2042575107 mt_rand() == 0x0000002f == 2042575107 mt_rand() == 0x00000030 == 1138202463 mt_rand() == 0x00000031 == 1138202463 mt_rand() == 0x00000032 == 727854615 mt_rand() == 0x00000033 == 727854615 mt_rand() == 0x00000034 == 1865016937 mt_rand() == 0x00000035 == 1865016937 mt_rand() == 0x00000036 == 821096978 mt_rand() == 0x00000037 == 821096978 mt_rand() == 0x00000038 == 342090783 mt_rand() == 0x00000039 == 342090783 mt_rand() == 0x0000003a == 356268007 mt_rand() == 0x0000003b == 356268007 mt_rand() == 0x0000003c == 558374924 mt_rand() == 0x0000003d == 558374924 mt_rand() == 0x0000003e == 1343365006 mt_rand() == 0x0000003f == 1343365006 mt_rand() == 0x00000040 == 508242842