ID: 43053 Comment by: nate at recoverydatabase dot net 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:
We just got bit by this on one of our servers running Fedora 7 and PHP 5.2.4 installed via yum. The others not causing any headaches are running Fedora 6 and PHP 5.1.6. It's not just a display problem - we have a mysql database with very large values in the primary keys, and when this server tries to insert data, or display, or lookup information based on those values it fails miserably. A php.ini option to disable the notation behavior would be nice. As for right now I must get back to downgrading. :( Previous Comments: ------------------------------------------------------------------------ [2007-12-29 01:50:56] daniel at fanetworks dot net I also noticed results coming as scientific notation for larger numbers in 5.1.6. Honestly, it should always come out in interger format with an option to return as notation. Having data not return in a reliable format is a serious issue. Its like $array = array(1=>2, 3=>4); sometimes returning with a serialized version of the array as a string instead of an actual array. Its hard to code when data is returning in an uncontrolled format :( ------------------------------------------------------------------------ [2007-12-01 08:07:06] owner at dragon-hearts dot net I could see it being desireable to have floats come out in normal or scientific format so maybe a php.ini setting would be in order for this. ------------------------------------------------------------------------ [2007-11-30 22:56:22] ross at newgrounds dot com 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. ------------------------------------------------------------------------ [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! ------------------------------------------------------------------------ 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