From: Antony Dovgal Date: Tue, 3 Oct 2006 17:54:51 +0000 (+0000) Subject: MFH: throw a warning when doing modulus by 0 (fr #39027) X-Git-Tag: php-5.2.0RC5~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e1c9371bbc68d433702b9a7e647c7ad268b050c;p=php MFH: throw a warning when doing modulus by 0 (fr #39027) --- diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index e7ed2073d5..12a3adfed5 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -918,6 +918,7 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) zendi_convert_to_long(op2, op2_copy, result); if (op2->value.lval == 0) { + zend_error(E_WARNING, "Division by zero"); ZVAL_BOOL(result, 0); return FAILURE; /* modulus by zero */ }