From: Antony Dovgal Date: Tue, 3 Oct 2006 17:54:32 +0000 (+0000) Subject: throw a warning when doing modulus by 0 (fr #39027) X-Git-Tag: RELEASE_1_0_0RC1~1453 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=55de312ce21590a5db17480b377b8ea5cebb1dab;p=php throw a warning when doing modulus by 0 (fr #39027) --- diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 7c346831ea..398dddc8dd 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -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 */ }