ID: 43053 Comment by: ross at newgrounds dot com Reported By: owner at dragon-hearts dot net Status: Verified Bug Type: Scripting Engine problem Operating System: Centos4 PHP Version: 5CVS-2007-10-25 New Comment:
I got bitten by this one too: $rounded = floor(14700002 / 1000) * 1000; in PHP 5.1.6, that yields: 14700000 in PHP 5.2.5, that yields: 1.47E+7 This is arguably acceptable behavior, but if this is the way it is, it should be a conscious decision, and documented. Previous Comments: ------------------------------------------------------------------------ [2007-11-25 01:22:07] owner at dragon-hearts dot net I have something that is closer to a solution If you replace the /zend/zend_objects.c file with the php-5.2.1 version before compiling php it fixes it. I have tested on php 5.2.2 and php5.2.5 (I assume versions in between will work) and haven't noticed any ill effects but I am only configuring with the following ./configure --disable-all --with-apxs2=/usr/local/apache/bin/apxs --prefix=/usr/local So I don't know if any other modules will break (though I will test later). Since it's in the Zend folder should I report it to zend? ------------------------------------------------------------------------ [2007-11-21 17:51:20] craig at craigmayhew dot com Theo's work around does indeed work. sprintf() or number_format() force the number to be displayed in an integer format. Thanks Theo! ------------------------------------------------------------------------ [2007-11-21 17:33:32] theo at lomasdavies dot net I am also experiencing this issue. As a work around you can use sprintf or number_format to force it to display correctly. not by any means a fix, but got me out of a jam. ------------------------------------------------------------------------ [2007-11-17 20:35:37] owner at dragon-hearts dot net Any idea when this might get fixed, since php5.2.5 has been released cpanel don't support 5.2.1 anymore hence it's not as easy to install 5.2.1 anymore and I'm stuck with 4.4.7 which won't be supported after December causing even more problems. ------------------------------------------------------------------------ [2007-11-13 13:54:02] rbro at hotmail dot com Yes, I haven't upgraded to the latest PHP 5.2.x for the same reasons as it's causing similar issues for me with dollar amount calculations (e.g. bug 42871). This change seems to have started in recent 5.2.x releases, but I don't recall it being on any changelog or announcement since it is causing backwards-compatibility issues with earlier PHP releases. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/43053 -- Edit this bug report at http://bugs.php.net/?id=43053&edit=1