|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-02-19 12:28 UTC] pajoye@php.net
[2010-02-22 08:56 UTC] phpnet4b7e640208df0 at mon-mail dot org
[2010-02-22 09:03 UTC] pajoye@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 00:00:01 2025 UTC |
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 )