Bug #71152 [NEW]: mt_rand() returns the different values from original mt19937ar.c
| From: | kusano4a at gmail dot com | Date: | Thu, 17 Dec 2015 19:13:26 +0000 |
| Subject: | Bug #71152 [NEW]: mt_rand() returns the different values from original mt19937ar.c | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-197972@lists.php.net to get a copy of this message | ||
From: kusano4a at gmail dot com
Operating system: All
PHP version: master-Git-2015-12-17 (Git)
Package: *Math Functions
Bug Type: Bug
Bug description:mt_rand() returns the different values from original mt19937ar.c
Description:
------------
mt_rand() returns the different values from original mt19937ar.c.
Although mt_rand() is required to be generate random numbers, I am
concerned about that this difference implies possibly deterioration of
randomness quality.
Test script:
---------------
<?php
mt_srand(12345678);
for ($i=0; $i<10; $i++)
echo mt_rand().PHP_EOL;
Expected result:
----------------
527860569
1711027313
1280820687
688176834
770499160
412773096
813703253
898651287
52508912
757323740
Actual result:
--------------
1614640687
1711027313
857485497
688176834
1386682158
412773096
813703253
898651287
2087374214
1382556330
--
Edit bug report at https://bugs.php.net/bug.php?id=71152&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71152&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71152&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71152&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=71152&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=71152&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=71152&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=71152&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=71152&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=71152&r=support
Expected behavior: https://bugs.php.net/fix.php?id=71152&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=71152&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=71152&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=71152&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71152&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=71152&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=71152&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=71152&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=71152&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=71152&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=71152&r=mysqlcfg