Bug #78660 [Com]: Round works different on PHP 7.4
| From: | s dot sayakci at shopware dot com | Date: | Thu, 10 Oct 2019 11:56:42 +0000 |
| Subject: | Bug #78660 [Com]: Round works different on PHP 7.4 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-223168@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78660&edit=1
ID: 78660
Comment by: s dot sayakci at shopware dot com
Reported by: s dot sayakci at shopware dot com
Summary: Round works different on PHP 7.4
Status: Open
Type: Bug
Package: *Math Functions
Operating System: Linux (NixOs)
PHP Version: 7.4.0RC3
Block user comment: N
Private report: N
New Comment:
I guess it's related to https://github.com/php/php-src/commit/0c0659dc50dc17b267072f95c6e1ebddcc91e82d#diff-b3ab69987aa0c09f941f1374aaf483c2R132
Previous Comments:
------------------------------------------------------------------------
[2019-10-10 11:48:17] s dot sayakci at shopware dot com
Description:
------------
We did found that round does work in different way in PHP 7.4 so our Tests are currently failing. I
checked the https://www.php.net/manual/en/migration74.incompatible.php
and could not found any change on round function.
When you pass -1 as float to round we got 0 until PHP 7.4, now we get also -1.
Is this change intended? Cause its not mentioned.
3v4l: https://3v4l.org/eLXVb
Test script:
---------------
var_dump((string) round((float) "-0", 2));
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78660&edit=1