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 ); } ?>
Output for 7.1.0
mt_rand() == 0xffffffffffffffef == 1733133565 mt_rand() == 0xfffffffffffffff0 == 815633481 mt_rand() == 0xfffffffffffffff1 == 971492061 mt_rand() == 0xfffffffffffffff2 == 121939955 mt_rand() == 0xfffffffffffffff3 == 195328217 mt_rand() == 0xfffffffffffffff4 == 2002047462 mt_rand() == 0xfffffffffffffff5 == 394193173 mt_rand() == 0xfffffffffffffff6 == 1848125447 mt_rand() == 0xfffffffffffffff7 == 526788312 mt_rand() == 0xfffffffffffffff8 == 376502768 mt_rand() == 0xfffffffffffffff9 == 119565662 mt_rand() == 0xfffffffffffffffa == 629985976 mt_rand() == 0xfffffffffffffffb == 922166515 mt_rand() == 0xfffffffffffffffc == 196438301 mt_rand() == 0xfffffffffffffffd == 1137703825 mt_rand() == 0xfffffffffffffffe == 1118123725 mt_rand() == 0xffffffffffffffff == 209663185 mt_rand() == 0x00000000 == 1178568022 mt_rand() == 0x00000001 == 895547922 mt_rand() == 0x00000002 == 936291924 mt_rand() == 0x00000003 == 1182829493 mt_rand() == 0x00000004 == 2076680765 mt_rand() == 0x00000005 == 476726705 mt_rand() == 0x00000006 == 1917402565 mt_rand() == 0x00000007 == 163870807 mt_rand() == 0x00000008 == 1875675361 mt_rand() == 0x00000009 == 22278335 mt_rand() == 0x0000000a == 1656398468 mt_rand() == 0x0000000b == 387126220 mt_rand() == 0x0000000c == 331062181 mt_rand() == 0x0000000d == 1670103209 mt_rand() == 0x0000000e == 1103684917 mt_rand() == 0x0000000f == 1822822116 mt_rand() == 0x00000010 == 479513940 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
Output for 5.2.1 - 7.0.14
mt_rand() == 0xffffffffffffffef == 1733133565 mt_rand() == 0xfffffffffffffff0 == 815633481 mt_rand() == 0xfffffffffffffff1 == 971492061 mt_rand() == 0xfffffffffffffff2 == 121939955 mt_rand() == 0xfffffffffffffff3 == 195328217 mt_rand() == 0xfffffffffffffff4 == 2002047462 mt_rand() == 0xfffffffffffffff5 == 394193173 mt_rand() == 0xfffffffffffffff6 == 1848125447 mt_rand() == 0xfffffffffffffff7 == 526788312 mt_rand() == 0xfffffffffffffff8 == 376502768 mt_rand() == 0xfffffffffffffff9 == 119565662 mt_rand() == 0xfffffffffffffffa == 629985976 mt_rand() == 0xfffffffffffffffb == 922166515 mt_rand() == 0xfffffffffffffffc == 196438301 mt_rand() == 0xfffffffffffffffd == 1137703825 mt_rand() == 0xfffffffffffffffe == 1118123725 mt_rand() == 0xffffffffffffffff == 209663185 mt_rand() == 0x00000000 == 963932192 mt_rand() == 0x00000001 == 1244335972 mt_rand() == 0x00000002 == 1216699170 mt_rand() == 0x00000003 == 969637571 mt_rand() == 0x00000004 == 76306251 mt_rand() == 0x00000005 == 1663152327 mt_rand() == 0x00000006 == 218286259 mt_rand() == 0x00000007 == 1989119265 mt_rand() == 0x00000008 == 277314967 mt_rand() == 0x00000009 == 2115503561 mt_rand() == 0x0000000a == 502355954 mt_rand() == 0x0000000b == 1750656698 mt_rand() == 0x0000000c == 1827696339 mt_rand() == 0x0000000d == 482358751 mt_rand() == 0x0000000e == 1048776771 mt_rand() == 0x0000000f == 334363538 mt_rand() == 0x00000010 == 1675573282 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
Output for 4.3.0 - 5.2.0
mt_rand() == 0xffffffffffffffef == 1560012225 mt_rand() == 0xfffffffffffffff0 == 192545069 mt_rand() == 0xfffffffffffffff1 == 192545069 mt_rand() == 0xfffffffffffffff2 == 149404652 mt_rand() == 0xfffffffffffffff3 == 149404652 mt_rand() == 0xfffffffffffffff4 == 1130687528 mt_rand() == 0xfffffffffffffff5 == 1130687528 mt_rand() == 0xfffffffffffffff6 == 520305616 mt_rand() == 0xfffffffffffffff7 == 520305616 mt_rand() == 0xfffffffffffffff8 == 760060341 mt_rand() == 0xfffffffffffffff9 == 760060341 mt_rand() == 0xfffffffffffffffa == 1274676573 mt_rand() == 0xfffffffffffffffb == 1274676573 mt_rand() == 0xfffffffffffffffc == 170016151 mt_rand() == 0xfffffffffffffffd == 170016151 mt_rand() == 0xfffffffffffffffe == 889885961 mt_rand() == 0xffffffffffffffff == 889885961 mt_rand() == 0x00000000 == 1898087491 mt_rand() == 0x00000001 == 1898087491 mt_rand() == 0x00000002 == 1309289693 mt_rand() == 0x00000003 == 1309289693 mt_rand() == 0x00000004 == 265425943 mt_rand() == 0x00000005 == 265425943 mt_rand() == 0x00000006 == 1768261887 mt_rand() == 0x00000007 == 1768261887 mt_rand() == 0x00000008 == 1529555610 mt_rand() == 0x00000009 == 1529555610 mt_rand() == 0x0000000a == 122486114 mt_rand() == 0x0000000b == 122486114 mt_rand() == 0x0000000c == 1288678054 mt_rand() == 0x0000000d == 1288678054 mt_rand() == 0x0000000e == 1330778215 mt_rand() == 0x0000000f == 1330778215 mt_rand() == 0x00000010 == 416543883 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