#23974 [Opn->Fbk]: Floating point data loss in serialize() (and sessions)

From: Date: Tue, 03 Jun 2003 09:31:20 +0000
Subject: #23974 [Opn->Fbk]: Floating point data loss in serialize() (and sessions)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-41008@lists.php.net to get a copy of this message
ID: 23974 Updated by: derick@php.net Reported By: ejik at transfer dot kg -Status: Open +Status: Feedback Bug Type: Scripting Engine problem Operating System: any PHP Version: 4.3.2 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip Previous Comments: ------------------------------------------------------------------------ [2003-06-03 03:27:45] ejik at transfer dot kg Bug #23298 Floating point data loss in serialize() (and sessions) This bug seems to be not fixed! Script: <?php ini_set("precision", 32); $var = 1.4285714285714286476; var_dump($var); $foo = serialize($var); echo ' ', $foo, "\n"; $x = unserialize($foo); var_dump($x); var_dump($x === $var); ini_set("precision", 12); $var = 1.4285714285714286476; var_dump($var); $foo = serialize($var); echo ' ', $foo, "\n"; $x = unserialize($foo); var_dump($x); var_dump($x === $var); ?> output: float(000ý) d:000ý; bool(false) bool(false) float(000ý) d:000ý; n bool(false) bool(false) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=23974&edit=1

« previous php.bugs (#41008) next »