ext/gmp: Improve error message

This commit is contained in:
Gina Peter Banyard 2024-04-23 22:51:06 +01:00
parent 71194ea767
commit 4719ef258f
3 changed files with 3 additions and 3 deletions

View file

@ -866,7 +866,7 @@ static inline void _gmp_unary_opl(INTERNAL_FUNCTION_PARAMETERS, gmp_unary_opl_t
static bool gmp_verify_base(zend_long base, uint32_t arg_num) static bool gmp_verify_base(zend_long base, uint32_t arg_num)
{ {
if (base && (base < 2 || base > GMP_MAX_BASE)) { if (base && (base < 2 || base > GMP_MAX_BASE)) {
zend_argument_value_error(arg_num, "must be between 2 and %d", GMP_MAX_BASE); zend_argument_value_error(arg_num, "must be 0 or between 2 and %d", GMP_MAX_BASE);
return false; return false;
} }

View file

@ -46,6 +46,6 @@ object(GMP)#1 (1) {
["num"]=> ["num"]=>
string(1) "6" string(1) "6"
} }
GMP::__construct(): Argument #2 ($base) must be between 2 and 62 GMP::__construct(): Argument #2 ($base) must be 0 or between 2 and 62
GMP::__construct(): Argument #1 ($num) is not an integer string GMP::__construct(): Argument #1 ($num) is not an integer string
GMP::__construct(): Argument #1 ($num) is not an integer string GMP::__construct(): Argument #1 ($num) is not an integer string

View file

@ -37,7 +37,7 @@ object(GMP)#1 (1) {
string(8) "98765678" string(8) "98765678"
} }
string(8) "98765678" string(8) "98765678"
gmp_init(): Argument #2 ($base) must be between 2 and 62 gmp_init(): Argument #2 ($base) must be 0 or between 2 and 62
gmp_init(): Argument #1 ($num) is not an integer string gmp_init(): Argument #1 ($num) is not an integer string
gmp_init(): Argument #1 ($num) is not an integer string gmp_init(): Argument #1 ($num) is not an integer string
gmp_init(): Argument #1 ($num) is not an integer string gmp_init(): Argument #1 ($num) is not an integer string