From: phpnet4b7e640208df0 at mon-mail dot org
Operating system: Windows Server 2003 R2 Standard
PHP version: 5.3.1
PHP Bug Type: Math related
Bug description: Serialisationof large numbers in arrays fails
Description:
------------
Unserialisation of serialised arrays containing large numbers fails and
unserialize returns FALSE.
The issue appears to be in serialized() since unserialising an array
serialised by an older version of PHP works as expected (as shown in
reproduce code).
No error is reported (as expected with unserialize()) and no crash.
Reproduce code:
---------------
<?
$anArray = Array();
$anArray["anumber"]=212133254400;
$anArray["anothernumber"]=212164790400;
print("Serialised: "); print(serialize($anArray)); print("\n");
print("Unserialised: "); print_r(unserialize(serialize($anArray)));
print("\n");
print("Error: ");
print(unserialize(serialize($anArray))===FALSE?"yes":"no"); print("\n");
print("Old style: ");
print_r(unserialize("a:2:{s:7:\"anumber\";d:212133254400;s:13:\"anothernumber\";d:212164790400;}"));
print("\n");
?>
Expected result:
----------------
Serialised:
a:2:{s:7:"anumber";d:212133254400;s:13:"anothernumber";d:212164790400;}
Unserialised:Array
(
[anumber] => 212133254400
[anothernumber] => 212164790400
)
Error: no
Old style: Array
(
[anumber] => 212133254400
[anothernumber] => 212164790400
)
Actual result:
--------------
Serialised:
a:2:{s:7:"anumber";d:2121332543:0;s:13:"anothernumber";d:2121647903:0;}
Unserialised:
Error: yes
Old style: Array
(
[anumber] => 212133254400
[anothernumber] => 212164790400
)
--
Edit bug report at http://bugs.php.net/?id=51089&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=51089&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=51089&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=51089&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=51089&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=51089&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=51089&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=51089&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=51089&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=51089&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=51089&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=51089&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=51089&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=51089&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=51089&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51089&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51089&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=51089&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=51089&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=51089&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=51089&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=51089&r=mysqlcfg