Re: [PHP6] Merging rand and mt_rand()
| From: | Rasmus Lerdorf | Date: | Sun, 23 Feb 2014 23:01:10 +0000 |
| Subject: | Re: [PHP6] Merging rand and mt_rand() | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-72778@lists.php.net to get a copy of this message | ||
On Feb 23, 2014, at 13:53, Andrea Faulds <ajf@ajf.me> wrote:
>
>
>> On 23 Feb 2014, at 20:22, Stas Malyshev <smalyshev@sugarcrm.com> wrote:
>> I would say anybody who relies on RNG producing preset numbers is asking
>> for trouble. If you need mock RNG, mock it out, don't rely on
>> undocumented properties of the system one.
>> But then again, refactoring and unifying RNGs is not very urgent thing
>> and a good candidate to put in a major version.
>
>
> What? PRNGs guarantee that for a given seed they will always produce the same sequence. All
> sorts of things do and should rely on this.
Yup, there is a lot of code out there that relies on this. Plenty of games rely on this for replays
or world generation. Just look at Minecraft world seeds, for example.
-Rasmus