Re: [PHP3] Serialize Problem

From: Date: Sat, 06 Nov 1999 09:11:58 +0000
Subject: Re: [PHP3] Serialize Problem
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-12166@lists.php.net to get a copy of this message
On Fri, 5 Nov 1999, jim kraai wrote: > All, > > Why does serialize truncate floats? fixed in PHP 3 and PHP 4 CVS - thanx for the report - serialize now uses the precision as set in php[3].ini! > > Example via cmd-line: > <?php > $a = 3.1415926535897932384626433832795; > print $a; > Content-type: text/html > > 3.1415926535898 > > print unserialize(serialize($a)); > 3.14159 > > print unserialize(serialize($a*10000)); > 314159 > > print unserialize(serialize($a*1000000)); > 3141590 > ?> > > Anybody know why this choice was made? Should we be fixing this? > > Also, two opinions on the serialize code--no offense meant. > 1. all that reallocation for every character is not exactly optimal reallocation takes place for every variable that get serialized (not every character) - that could be optimized - i agree. > 2. why is the type flag for an index the same as for an integer? because they are ints. and changing it now would make it it incompatible. regards, tc > > Thanks, > > --jim > > -- > PHP 3 Mailing List <http://www.php.net/> > To unsubscribe, send an empty message to php3-unsubscribe@lists.php.net > To subscribe to the digest, e-mail: php3-digest-subscribe@lists.php.net > To search the mailing list archive, go to: ‰†'3ýû9Ñ! > ⺄whttp://www.php.net/mailsearch.php3 > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!" Digital Collections Phone +49 40 235350 Fax +49 40 23535180 Hammerbrookstr. 93 20097 Hamburg / Germany

« previous php.dev (#12166) next »