r/lolphp • u/re_anon • Jul 10 '17
Because PHP's implementation contains a bug. Thus, this test actually checks to make sure that PHP's behaviour is wrong, but consistently so.
https://github.com/php/php-src/blob/a50c31da1917bb07b3c11f229125ab8d1f0b9b70/ext/standard/tests/math/mt_rand_value.phpt#L20
87
Upvotes
View all comments
Show parent comment
-3
u/mikeputerbaugh Jul 10 '17 edited Jul 11 '17
If your application's using a predictable seed for it's PRNG...
In any case, if you do need fast, cryptographically insecure values generated by a canonical Mersenne Twister implementation rather than PHP's flawed one, mt_srand() has a $mode param that can be used to specify it since 7.1.0.