[php-src] Issue #20593: Incorrect rounding in 8.4+
| From: | 835301-cmyk | Date: | Tue, 25 Nov 2025 23:39:53 +0000 |
| Subject: | [php-src] Issue #20593: Incorrect rounding in 8.4+ | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-251309@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/20593
Author: 835301-cmyk
### Description
The following code:
https://3v4l.org/UMTPf
```php
<?php
$v = 190*1.15;
print("\$v = $v (190*1.15)\n");
print("round(\$v) = ".round($v)."\n");
print("round(218.5) = ".round(218.5)."\n");
```
Resulted in this output:
```
$v = 218.5 (190*1.15)
round($v) = 218
round(218.5) = 219
```
in 8.4+
But I expected this output instead:
```
$v = 218.5 (190*1.15)
round($v) = 219
round(218.5) = 219
```
It works correctly in PHP < 8.4
### PHP Version
```plain
PHP 8.4.11 (cli) (built: Aug 3 2025 07:32:21) (NTS)
Copyright (c) The PHP Group
Built by Debian
Zend Engine v4.4.11, Copyright (c) Zend Technologies
with Zend OPcache v8.4.11, Copyright (c), by Zend Technologies
```
### Operating System
_No response_