Serialize Problem
| From: | jim kraai | Date: | Fri, 05 Nov 1999 23:09:07 +0000 |
| Subject: | Serialize Problem | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-12152@lists.php.net to get a copy of this message | ||
All,
Why does serialize truncate floats?
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
2. why is the type flag for an index the same as for an integer?
Thanks,
--jim