From:             sgarrouste at agencecap dot net
Operating system: Linux Suze
PHP version:      4.3.3
PHP Bug Type:     Unknown/Other Function
Bug description:  Problem with serialize function

Description:
------------
Hello

I have un bug with the function serialize.
I need to serialize object for testing if they not changed.
The bug appear when i serialize type is double but disappear when i
unzerialize.
i explain this in the reproduce code.
i think it's a problem of approximation.

thank for the answer.

ps: my english is not very good, excuse me

Reproduce code:
---------------
<?php

$test = 13.1;
echo "test = ".$test."<br>";
$test2 = serialize($test);
echo "test2(serialize) = ".$test2."<br>";
echo "test2(unserialize) = ".unserialize($test2);

?>

Expected result:
----------------
test = 13.1
test2(serialize) = d:13.1;
test2(unserialize) = 13.1

Actual result:
--------------
test = 13.1
test2(serialize) =
d:13.0999999999999996447286321199499070644378662109375;
test2(unserialize) = 13.1

-- 
Edit bug report at http://bugs.php.net/?id=26247&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26247&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26247&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26247&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26247&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26247&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=26247&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26247&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26247&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26247&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26247&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26247&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26247&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26247&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26247&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26247&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26247&r=float

Reply via email to