Re: PRNG: Raise warning and/or provide better pseudo random generator?
| From: | Christoph Becker | Date: | Tue, 23 Feb 2016 11:23:34 +0000 |
| Subject: | Re: PRNG: Raise warning and/or provide better pseudo random generator? | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-91355@lists.php.net to get a copy of this message | ||
On 23.02.2016 at 11:41, Yasuo Ohgaki wrote:
> Actual range could be determined by PHP_RAND_MAX/PHP_MT_RAND_MAX, but
> I heard Windows' PHP_RAND_MAX is only 2^15. Is this correct?
Yes, see <https://msdn.microsoft.com/en-us/library/398ax69y.aspx>.
> Any comments for adding out of range warnings to rand()/mt_rand()? If
> nobody has comment on this, I'll write RFC for additional warnings.
> Anyone prefer to extend rand()/mt_rand() for 64bit OSes?
See also the discussion for <https://github.com/php/php-src/pull/1416>;
it might make sense to disallow such ranges in the long run (i.e. for
PHP 8), in which case we might want to raise deprecated notices instead
of warnings now.
--
Christoph M. Becker