Bug #78660 [PATCH]: Round works different on PHP 7.4

From: Date: Fri, 11 Oct 2019 09:15:37 +0000
Subject: Bug #78660 [PATCH]: Round works different on PHP 7.4
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-223172@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 Patch added by: jhdxr@php.net 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: The following pull request has been associated: Patch Name: fix bug #78660 rounding negative zero On GitHub: https://github.com/php/php-src/pull/4813 Patch: https://github.com/php/php-src/pull/4813.patch Previous Comments: ------------------------------------------------------------------------ [2019-10-10 11:56:42] s dot sayakci at shopware dot com I guess it's related to https://github.com/php/php-src/commit/0c0659dc50dc17b267072f95c6e1ebddcc91e82d#diff-b3ab69987aa0c09f941f1374aaf483c2R132 ------------------------------------------------------------------------ [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

« previous php.bugs (#223172) next »