[php-src] master: ext/gmp: Improve error message

From: Date: Tue, 23 Apr 2024 22:39:56 +0000
Subject: [php-src] master: ext/gmp: Improve error message
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-128226@lists.php.net to get a copy of this message
Author: Gina Peter Banyard (Girgias) Date: 2024-04-23T23:39:48+01:00 Commit: https://github.com/php/php-src/commit/4719ef258fb7c67cb41fb12751eca2ed6cbbcb95 Raw diff: https://github.com/php/php-src/commit/4719ef258fb7c67cb41fb12751eca2ed6cbbcb95.diff ext/gmp: Improve error message Changed paths: M ext/gmp/gmp.c M ext/gmp/tests/construct.phpt M ext/gmp/tests/gmp_init.phpt Diff: diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index 7ae3de3671dca..dddd875dac37a 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -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) { 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; } diff --git a/ext/gmp/tests/construct.phpt b/ext/gmp/tests/construct.phpt index 11c80b3d9ed82..1b23bd791edd1 100644 --- a/ext/gmp/tests/construct.phpt +++ b/ext/gmp/tests/construct.phpt @@ -46,6 +46,6 @@ object(GMP)#1 (1) { ["num"]=> 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 diff --git a/ext/gmp/tests/gmp_init.phpt b/ext/gmp/tests/gmp_init.phpt index 6ca421b3e8601..4032b54ba47e1 100644 --- a/ext/gmp/tests/gmp_init.phpt +++ b/ext/gmp/tests/gmp_init.phpt @@ -37,7 +37,7 @@ object(GMP)#1 (1) { 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

« previous php.cvs (#128226) next »