|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #32145 Mersenne Twister seed option required
Submitted: 2005-03-01 10:25 UTC Modified: 2016-12-30 22:48 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: hardeman at nmni dot net Assigned:
Status: Open Package: Math related
PHP Version: All versions OS: All OS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
9 + 22 = ?
Subscribe to this entry?

 [2005-03-01 10:25 UTC] hardeman at nmni dot net
Unless the PHP documentation is not up-to-date, the only seed option for the Mersenne Twister RNG is a 32-bit integer. The original (updated) MT implementation (see, however, allows for seed arrays of arbitrary length to better exploit the large period of the RNG. It would be nice if this option were built in in future versions of PHP so that I myself and probably quite a few other PHP users won't have to implement the RNG in PHP code itself or create a private extension in C++. Adding this feature to PHP should not require a lot of effort as other implementations are readily available.


1e8bPhq.out (last revision 2013-12-12 18:40 UTC by bebymiss at yahoo dot co dot uk)

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-04 15:33 UTC] hardeman at nmni dot net
As a temporary solution, I have now created a PHP class which implements the Mersenne Twister PRNG with the updated initialization methods. I can make this class available to other PHP users - just send me a mail.

Hendrik Hardeman
 [2016-12-30 22:48 UTC]
-Package: Feature/Change Request +Package: Math related
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Oct 24 05:03:39 2021 UTC