php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23974 Floating point data loss in serialize() (and sessions)
Submitted: 2003-06-03 03:27 UTC Modified: 2003-06-09 08:42 UTC
From: ejik at transfer dot kg Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 4.3.2 OS: any
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ejik at transfer dot kg
New email:
PHP Version: OS:

 

 [2003-06-03 03:27 UTC] 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)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-09 08:42 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 16:01:28 2024 UTC