3 ms·
Normally reusing the standard implementation is the right way to do things. But in the case of C's rand(), it's so awful that PHP's rand() using it under the ho
by TazeTSchnitzel 9y ago
Normally reusing the standard implementation is the right way to do things. But in the case of C's rand(), it's so awful that PHP's rand() using it under the hood was considered a serious flaw in PHP, and has now been replaced with Mersenne Twister. (Which is itself not a particularly good PRNG, but it's so much better than rand() you'd be forgiven for ignoring that.)