Re: mt_rand() - the same forever?
| From: | Janek | Date: | Mon, 06 Oct 2008 14:59:28 +0000 |
| Subject: | Re: mt_rand() - the same forever? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-281484@lists.php.net to get a copy of this message | ||
On Mon, Oct 6, 2008 at 1:53 PM, Eric Butera <eric.butera@gmail.com> wrote:
> On Sun, Oct 5, 2008 at 2:25 PM, Janek <j-sz@o2.pl> wrote:
>> I wonder whether I can rely on the stability of mt_srand() and
>> mt_rand(). I want them to generate the same sequence for a fixed seed,
>> regardless of PHP version. Do you think I can trust it?
>> Janek
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> A while ago I saw on internals where someone was talking about why
> their random numbers weren't giving the same response using the same
> seed anymore after upgrading. The dev's said a random number is a
> random number and should never be relied upon to give the same result,
> ever. That may have been a different function, but I'm sure that
> mindset would persist across all random functions.
>
Thanks, that settles it. I think I will use the second idea from
Jochem or something like that.
Janek