php > $minus_zero = -0.0; php > $plus_zero = +0.0; php > var_dump(1.0 / $minus_zero); PHP Warning: Uncaught DivisionByZeroError: Division by zero in php shell code:1
The result of that division is a float with a value of -INF, INF being a constant that PHP treats as infinite.
But as of PHP 8 dividing by zero causes a fatal error and execution is halted.
This site is really good for comparing results in different PHP versions: https://3v4l.org/9Tl1I
I actually wasn't aware that PHP had an INF contant but seeing the warning in your output prompted me to dig a little bit deeper :)
The result of that division is a float with a value of -INF, INF being a constant that PHP treats as infinite.
But as of PHP 8 dividing by zero causes a fatal error and execution is halted.
This site is really good for comparing results in different PHP versions: https://3v4l.org/9Tl1I
I actually wasn't aware that PHP had an INF contant but seeing the warning in your output prompted me to dig a little bit deeper :)