You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The long answer is that rand() is effectively an alias for mt_rand() since 7.1, with the exception of accepting $min and $max in reserve order. See php/php-src@9a90043. And whether that was intentionally supported in the first place is not clear. It appears to be a side effect of the implementation of the biased scaler used before PHP 7.2.
Unfortunately the documentation still needs to document PHP 7.x, otherwise the page for rand() could simply be merged with that one for mt_rand(). Or be made a stub, similarly to sizeof().
In the notes section of rand() it says:
(max - min) <= getrandmax()
But must be
abs(max - min) <= getrandmax()
The text was updated successfully, but these errors were encountered: