]> granicus.if.org Git - php/commitdiff
MFH: throw a warning when doing modulus by 0 (fr #39027)
authorAntony Dovgal <tony2001@php.net>
Tue, 3 Oct 2006 17:54:51 +0000 (17:54 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 3 Oct 2006 17:54:51 +0000 (17:54 +0000)
Zend/zend_operators.c

index e7ed2073d51fc39ec23c1c824dd1cceede2f9e04..12a3adfed5271d47a3361ef2a79146a1c50f3aba 100644 (file)
@@ -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 */
        }