Skip to content

Fix UNKNOWN default values in ext/standard #6026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

kocsismate
Copy link
Member

No description provided.

@kocsismate kocsismate force-pushed the standard-default branch 2 times, most recently from 4fc13d3 to 7845f73 Compare September 1, 2020 15:59
@kocsismate kocsismate force-pushed the standard-default branch 2 times, most recently from b4071d0 to 2369e9c Compare September 4, 2020 13:15

if (max_is_null) {
max = PHP_MT_RAND_MAX;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO we should not touch mt_rand. The behavior implemented here is very unusual in that mt_rand($n) will now return mt_rand($n, mt_getrandmax()). It is a lot more typical for single-argument rand functions to interpret the argument as the upper bound, not the lower bound.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, after rethinking it, it is very unusual indeed. I'll revert it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants