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