#27646 [Opn->Fbk]: Cannot serialize/unserialize non-finite numeric values
| From: | helly@php.net | Date: | Tue, 23 Mar 2004 21:01:19 +0000 |
| Subject: | #27646 [Opn->Fbk]: Cannot serialize/unserialize non-finite numeric values | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-56712@lists.php.net to get a copy of this message | ||
ID: 27646
Updated by: helly@php.net
Reported By: matthew_kay at ml1 dot net
-Status: Open
+Status: Feedback
Bug Type: Zend Engine 2 problem
Operating System: Linux 2.4.22 (Mandrake 9.2)
PHP Version: 5.0.0RC1
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2004-03-18 21:29:14] matthew_kay at ml1 dot net
Description:
------------
It appears that unserialize() does not unserialize
numerics that are "non-finite", such as NAN and INF.
Instead, it simply fails and returns (bool)false.
If a NAN value is encountered anywhere during an
unserialize() (for example, in an array or an object), the
entire operation fails and unserialize will return false.
Reproduce code:
---------------
$testNan = (float)NAN;
var_dump($testNan); //outputs float(NAN)
$testNan2 = unserialize(serialize($testNan));
var_dump($testNan2); //outputs bool(false)
$testInf = (float)INF;
var_dump($testInf); //outputs float(INF)
$testInf2 = unserialize(serialize($testInf));
var_dump($testInf2); //outputs bool(false)
Expected result:
----------------
float(NAN)
float(NAN)
float(INF)
float(INF)
Actual result:
--------------
float(NAN)
bool(false)
float(INF)
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=27646&edit=1