Cannot Raise Zero To Negative Powers
Raising 0 to a negative power used to generate a INF value, aka infinity. The standard behavior is to generate a DivisionByZeroError, as this is not mathematically allowed. This behavior is deprecated in PHP 8.4, and will be removed in PHP 8.4. During the transition, a function called fpow() is provided, with the new behavior.
PHP code
<?php
var_dump(0 ** -1); //Deprecated: Zero raised to a negative power is deprecated
?>
Before
float(INF)
After
PHP Deprecated: Power of base 0 and negative exponent is deprecated
Deprecated: Power of base 0 and negative exponent is deprecated
float(INF)
PHP version change
This behavior was deprecated in 8.4.
This behavior changed in 9.0.