note 107017 deleted from function.mt-rand by danbrown
| From: | danbrown@php.net | Date: | Tue, 03 Jan 2012 21:55:41 +0000 |
| Subject: | note 107017 deleted from function.mt-rand by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-185303@lists.php.net to get a copy of this message | ||
Note Submitter: daniel at danielnorton dot com
----
Although this is already filed as a bug, it's an extremely serious bug, so I think it warrants
a warning here until the PHP maintainers can address it and update this documentation accordingly.
The problem, generally, is that mt_rand() fails for certain combinations of $min and $max if $min is
less than zero. Specifically, it fails if ($max - $min) <= mt_getrandmax (). The further outside
that range, the more likely it is to fail.
More at https://bugs.php.net/bug.php?id=60543