-
Notifications
You must be signed in to change notification settings - Fork 702
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
gmp_mod(): Argument #1 ($num1) is not an integer string #3336
Comments
As per the answer on stackoverflow, a numeric string that starts with a 0 will be interpreted as an octal number.
Just as binary numbers do not have the character "2", octal numbers do not have the characters "8" and "9". Therefore, if a numeric string that is to be interpreted as octal contains an "8" or a "9", it is an invalid string. |
Making this a doc bug: the parameters say "numeric string" and then link to the strings page, which should have been a link to the numeric strings page except that "numeric string" isn't actually meant as PHP defines it but as GMP::__construct and gmp_init describe it:
Applies to all the GMP functions, or at least presumably to all usages of |
Description
The following code:
Resulted in this output:
Only seems to happen when the start of the string contains a zero. Also asked at https://stackoverflow.com/questions/78371967/gmp-mod-argument-1-num1-is-not-an-integer-string-hashids-package
But I expected a correct output
usin t
PHP Version
8.3.6
Operating System
CentOS 9 stream
The text was updated successfully, but these errors were encountered: