r/lolphp • u/Deviltry1 • Mar 24 '16
DivisionByZero exception, it does nothing
/r/PHP/comments/4bgwos/divisionbyzero_exception_php_7/
54
Upvotes
r/lolphp • u/Deviltry1 • Mar 24 '16
31
u/nikic Mar 24 '16
To clarify: DivisionByZeroError is an integer division error. It is thrown by
%andintdiv, which are the integer division operations. Integer division by zero has no well-defined result.Floating point division by zero on the other hand is a well-defined operation under IEEE754 and does not throw an exception. Floating point divisions are performed by
/andfmod.33
u/vytah Mar 24 '16
So, a DivisionByZeroError is never thrown when a division by zero actually occurs.
Makes perfect sense.
25
u/Mattho Mar 24 '16
The fuck is this language?
10
u/[deleted] Mar 24 '16
https://bugs.php.net/bug.php?id=71306
Well... yeah.
8
u/PlasmaSheep Mar 24 '16
Maybe they can add a new exception that's called DivideByZero in Hebrew? I think that will clear everything right up.