Login or register your account to reply
Mark Dain Hahaha well I'm glad they're preserving backwards compatibility! You can't really fix a bug in mt_rand as it's not truly random so there's a chance someone will depend on the output - of a function called rand - being predictable, amazingly. sigh. Just use random_int on 7+ and paragonie/random_compat on 5.x if you want quality random numbers (you probably want that)
5y, 6w 1 reply
Martijn The amount of people who don't understand the "mt" in mt_rand is astonishing though But really, the function should never have shipped broken and I believe it is fixed in PHP 7.1. This older test and its comment is simply amazing still.
5y, 6w reply