summaryrefslogtreecommitdiff
path: root/ext/standard/math.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/math.c')
-rw-r--r--ext/standard/math.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/standard/math.c b/ext/standard/math.c
index cff798c9fb..a3685c00b9 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -1458,7 +1458,8 @@ PHP_FUNCTION(intdiv)
} else if (divisor == -1 && numerator == ZEND_LONG_MIN) {
/* Prevent overflow error/crash
We don't return a float here as that violates function contract */
- RETURN_LONG(0);
+ zend_throw_exception_ex(NULL, 0, "Division of PHP_INT_MIN by -1 is not an integer");
+ return;
}
RETURN_LONG(numerator/divisor);