The purpose of a random number function is to get — you guessed it — a random number, something you cannot predict (or be very hard to predict with certainty). If the mt_rand() function is faster and less predictable (more “random”) than the old rand(), why not just switch the underlying implementation to the new method?
To put it another way, what kind of program that uses rand() would break in a later version of PHP if/because the underlying implementation changed?
Mainly because that’s the PHP way. Just like they added
mysql_real_escape_stringinstead of replacingmysql_escape_stringwith it.However, it might also be related to the disadvantages the mersenne-twister algorithm has (I have no clue if they are also present in the
rand()algorithm though):