Skip to content

random: clarify that getrandmax was small only before PHP 7.1 #4664

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

Merged
merged 1 commit into from
May 8, 2025

Conversation

takaram
Copy link
Contributor

@takaram takaram commented May 8, 2025

Since PHP 7.1 getrandmax is an alias of mt_getrandmax, which returns 2**31 - 1

Since PHP 7.1 `getrandmax` is an alias of `mt_getrandmax`,
which returns 2**31 - 1
@takaram takaram requested a review from TimWolla as a code owner May 8, 2025 15:55
Copy link
Member

@TimWolla TimWolla left a comment

Choose a reason for hiding this comment

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

Thanks!

@TimWolla TimWolla merged commit bf672f5 into php:master May 8, 2025
2 checks passed
@takaram takaram deleted the patch-1 branch May 15, 2025 18:21
KentarouTakeda pushed a commit to php/doc-ja that referenced this pull request May 27, 2025
* mt_rand() はPHP 8.0以降ValueError をスローする (php/doc-en#4660)

* `getrandmax`が小さいのはPHP 7.1までであることを明示 (php/doc-en#4664)

* 誤字訂正

* Mt19937 の重複についての訳を改善

* 「重複したシードが存在します」→「シードが重複します」
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