[php-src] Issue #11270: Unexpected behavior in division by zero in algebraic expressions

From: Date: Thu, 18 May 2023 20:04:45 +0000
Subject: [php-src] Issue #11270: Unexpected behavior in division by zero in algebraic expressions
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-244481@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/11270 Author: andmarruda ### Description The following code: ```php <?php function limit(float $x) : float { return pow($x,2) - 4 / pow($x,2) - $x - 2; } var_dump(limit(2)); ``` Resulted in this output: ``` float(-1); ``` But I expected this output instead: ``` Division by zero error ``` I have used PHP 8.2.5. ![image](https://github.com/php/php-src/assets/29872593/fd56f6f1-c99a-4d0b-96d3-ca7e8f9173f6) Is this an unexpected behavior or has some explanation? Thanks to everyone! ### PHP Version PHP 8.2.5 ### Operating System Debian GNU/Linux 10 (buster)

« previous php.bugs (#244481) next »