Skip to content

ext/gmp: Fix GMP error messages using outdated parameter names - #22846

Merged
LamentXU123 merged 1 commit into
php:masterfrom
LamentXU123:gmp-
Jul 21, 2026
Merged

ext/gmp: Fix GMP error messages using outdated parameter names#22846
LamentXU123 merged 1 commit into
php:masterfrom
LamentXU123:gmp-

Conversation

@LamentXU123

@LamentXU123 LamentXU123 commented Jul 21, 2026

Copy link
Copy Markdown
Member

The argument name in these error messages are different from what is claimed in the documentation and public signatures.

Updated messages:

  • gmp_root() and gmp_rootrem() now refer to argument 1 as $num instead of $a.
  • gmp_random_range() now refers to argument 2 as $max instead of $maximum.

TBH this is discovered when I am developing an application using gmp, and it take me some time to figure out what $a is in the error message.

Maybe we shouldn't hard code the argument name at first. IMO this is classic bad practice.

@LamentXU123
LamentXU123 merged commit f2b6b7f into php:master Jul 21, 2026
17 of 18 checks passed
@LamentXU123
LamentXU123 deleted the gmp- branch July 21, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants