1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 18:53:33 +02:00

throw a warning when doing modulus by 0 (fr #39027)

This commit is contained in:
Antony Dovgal
2006-10-03 17:54:32 +00:00
parent 25ac82bbb6
commit 55de312ce2
+1
View File
@@ -1297,6 +1297,7 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
zendi_convert_to_long(op2, op2_copy, result);
if (Z_LVAL_P(op2) == 0) {
zend_error(E_WARNING, "Division by zero");
ZVAL_BOOL(result, 0);
return FAILURE; /* modulus by zero */
}