Skip to content

Commit 017db5a

Browse files
committed
Fix exception message
1 parent 0a877ad commit 017db5a

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

ext/gmp/gmp.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -336,13 +336,10 @@ static void shift_operator_helper(gmp_binary_ui_op_t op, zval *return_value, zva
336336
zend_long shift = zval_get_long(op2);
337337

338338
if (shift < 0) {
339-
if (strcmp(get_active_function_name(), "main")) {
340-
zend_argument_value_error(2, "must be greater than or equal to 0");
341-
} else {
342-
zend_throw_error(zend_ce_value_error, "%s must be greater than or equal to 0",
343-
opcode == ZEND_POW ? "Exponent" : "Shift"
344-
);
345-
}
339+
zend_throw_error(
340+
zend_ce_value_error, "%s must be greater than or equal to 0",
341+
opcode == ZEND_POW ? "Exponent" : "Shift"
342+
);
346343
return;
347344
} else {
348345
mpz_ptr gmpnum_op, gmpnum_result;

ext/gmp/tests/gmp_pow2.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ object(GMP)#%d (1) {
3131
["num"]=>
3232
string(4) "1024"
3333
}
34-
pow(): Argument #2 ($exp) must be greater than or equal to 0
34+
Exponent must be greater than or equal to 0
3535
Exponent must be greater than or equal to 0

0 commit comments

Comments
 (0)