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() == 0x00000011632788279 mt_rand() == 0x000000121396668053 mt_rand() == 0x00000013209451822 mt_rand() == 0x000000141263001265 mt_rand() == 0x00000015104635876 mt_rand() == 0x00000016447665594 mt_rand() == 0x000000171110888745 mt_rand() == 0x000000182061621457 mt_rand() == 0x000000191868577346 mt_rand() == 0x0000001a661285274 mt_rand() == 0x0000001b914229769 mt_rand() == 0x0000001c1565545088 mt_rand() == 0x0000001d1854910442 mt_rand() == 0x0000001e1383287698 mt_rand() == 0x0000001f614295913 mt_rand() == 0x000000201844450667 mt_rand() == 0x00000021533671434 mt_rand() == 0x0000002282810576 mt_rand() == 0x00000023983665508 mt_rand() == 0x000000241564457282 mt_rand() == 0x000000252028291015 mt_rand() == 0x00000026826293968 mt_rand() == 0x000000271174435524 mt_rand() == 0x00000028875501219 mt_rand() == 0x00000029538854368 mt_rand() == 0x0000002a804318771 mt_rand() == 0x0000002b247077794 mt_rand() == 0x0000002c1792809866 mt_rand() == 0x0000002d2123886053 mt_rand() == 0x0000002e1683267166 mt_rand() == 0x0000002f243714627 mt_rand() == 0x0000003037560064 mt_rand() == 0x00000031646316245 mt_rand() == 0x000000321062148952 mt_rand() == 0x000000331451122175 mt_rand() == 0x000000341767615994 mt_rand() == 0x000000351818193676 mt_rand() == 0x00000036902336055 mt_rand() == 0x00000037199948518 mt_rand() == 0x000000382113535914 mt_rand() == 0x00000039187581927 mt_rand() == 0x0000003a784058257 mt_rand() == 0x0000003b1984350296 mt_rand() == 0x0000003c646120550 mt_rand() == 0x0000003d1770534705 mt_rand() == 0x0000003e72487689 mt_rand() == 0x0000003f1189579286 mt_rand() == 0x00000040814107874
Output for 5.2.1 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.0.14
mt_rand() == 0x000000111526489153 mt_rand() == 0x00000012745833443 mt_rand() == 0x000000131932529240 mt_rand() == 0x00000014873212871 mt_rand() == 0x000000152037868690 mt_rand() == 0x000000161709514956 mt_rand() == 0x000000171031611487 mt_rand() == 0x0000001895038887 mt_rand() == 0x00000019271306548 mt_rand() == 0x0000001a1478597868 mt_rand() == 0x0000001b1228275583 mt_rand() == 0x0000001c572237814 mt_rand() == 0x0000001d298080924 mt_rand() == 0x0000001e758693604 mt_rand() == 0x0000001f1540791327 mt_rand() == 0x00000020314302493 mt_rand() == 0x000000211619319676 mt_rand() == 0x000000222074370982 mt_rand() == 0x000000231172995602 mt_rand() == 0x00000024578047028 mt_rand() == 0x00000025128890545 mt_rand() == 0x000000261309395878 mt_rand() == 0x00000027961250226 mt_rand() == 0x000000281264903125 mt_rand() == 0x000000291599452822 mt_rand() == 0x0000002a1354439493 mt_rand() == 0x0000002b1911680724 mt_rand() == 0x0000002c362278652 mt_rand() == 0x0000002d31201427 mt_rand() == 0x0000002e455043880 mt_rand() == 0x0000002f1909276469 mt_rand() == 0x000000302104945270 mt_rand() == 0x000000311506669987 mt_rand() == 0x000000321074064942 mt_rand() == 0x00000033691382409 mt_rand() == 0x00000034370169996 mt_rand() == 0x00000035320117370 mt_rand() == 0x000000361250130753 mt_rand() == 0x000000371956711824 mt_rand() == 0x0000003845222620 mt_rand() == 0x000000391952821393 mt_rand() == 0x0000003a1374696167 mt_rand() == 0x0000003b151862574 mt_rand() == 0x0000003c1506341136 mt_rand() == 0x0000003d381928007 mt_rand() == 0x0000003e2065294975 mt_rand() == 0x0000003f967606112 mt_rand() == 0x000000401338882452
Output for 4.3.0 - 5.2.0
mt_rand() == 0x00000011416543883 mt_rand() == 0x000000121563109322 mt_rand() == 0x000000131563109322 mt_rand() == 0x000000141722492715 mt_rand() == 0x000000151722492715 mt_rand() == 0x00000016324013731 mt_rand() == 0x00000017324013731 mt_rand() == 0x000000181494098308 mt_rand() == 0x000000191494098308 mt_rand() == 0x0000001a1710099468 mt_rand() == 0x0000001b1710099468 mt_rand() == 0x0000001c946042951 mt_rand() == 0x0000001d946042951 mt_rand() == 0x0000001e697841096 mt_rand() == 0x0000001f697841096 mt_rand() == 0x000000201471289099 mt_rand() == 0x000000211471289099 mt_rand() == 0x00000022848264191 mt_rand() == 0x00000023848264191 mt_rand() == 0x000000241423108845 mt_rand() == 0x000000251423108845 mt_rand() == 0x000000262040034561 mt_rand() == 0x000000272040034561 mt_rand() == 0x000000282136803592 mt_rand() == 0x000000292136803592 mt_rand() == 0x0000002a1387371436 mt_rand() == 0x0000002b1387371436 mt_rand() == 0x0000002c1401763010 mt_rand() == 0x0000002d1401763010 mt_rand() == 0x0000002e2042575107 mt_rand() == 0x0000002f2042575107 mt_rand() == 0x000000301138202463 mt_rand() == 0x000000311138202463 mt_rand() == 0x00000032727854615 mt_rand() == 0x00000033727854615 mt_rand() == 0x000000341865016937 mt_rand() == 0x000000351865016937 mt_rand() == 0x00000036821096978 mt_rand() == 0x00000037821096978 mt_rand() == 0x00000038342090783 mt_rand() == 0x00000039342090783 mt_rand() == 0x0000003a356268007 mt_rand() == 0x0000003b356268007 mt_rand() == 0x0000003c558374924 mt_rand() == 0x0000003d558374924 mt_rand() == 0x0000003e1343365006 mt_rand() == 0x0000003f1343365006 mt_rand() == 0x00000040508242842