Re: [PHP6] Merging rand and mt_rand()
| From: | Nikita Popov | Date: | Sun, 23 Feb 2014 19:08:39 +0000 |
| Subject: | Re: [PHP6] Merging rand and mt_rand() | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-72773@lists.php.net to get a copy of this message | ||
On Sun, Feb 23, 2014 at 7:45 PM, Rouven Weßling <me@rouvenwessling.de>wrote:
> Hello internals,
>
> there has already been a lot of talk about improving secure random number
> generation for PHP6. One thing I'd like to improve as well, would be
> non-secure random number generation. Here is not so much security at stake
> but ease of use.
>
> The obvious solution, would be to rename mt_rand to rand and make rand an
> alias. (The same for the supporting functions mt_srand and mt_getrandmax)..
>
> What I'm missing is the history. What was the reason to keep the separate?
> Am I missing something?
>
> Best regards
> Rouven
>
Changing the random number generation algorithm is a BC break, e.g. tests
could rely on certain random number sequences for a certain seed. However
it sounds reasonable to make rand, array_shuffle, str_shuffle etc make use
of MT 19937 in PHP6, as we have a bit more freedom with breakage.
Nikita