Re: [RFC] RNG fixes

From: Date: Thu, 23 Jun 2016 14:09:12 +0000
Subject: Re: [RFC] RNG fixes
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.internals 
Request: Send a blank email to internals+get-94227@lists.php.net to get a copy of this message
On 23/06/2016 14:57, Nikita Popov wrote:
Whatever we do, please maintain the invariant that mt_rand() >= rand() in terms of quality. I recommend doing this by making mt_rand() == rand().
The relationship that I feel is poorly defined at the moment is random_int() vs mt_rand(). There isn't actually anything in the manual to say when *not* to use it. So the implication seems to be random_int()
mt_rand() > rand().
I would prefer something like random_fast_int() == mt_rand() == rand(), with clear documentation on when to use random_fast_int() instead of random_int(), and a note on the others that "since 7.2, mt_rand() is an alias for random_fast_int()" etc. (Not wedded to the name random_fast_int, we can bikeshed that later.) Regards, -- Rowan Collins [IMSoP]

« previous php.internals (#94227) next »