|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-07 20:09 UTC] sniper@php.net
[2005-03-08 07:33 UTC] csmith at cbbc dot murdoch dot edu dot au
[2005-03-09 00:52 UTC] sniper@php.net
[2005-03-09 10:45 UTC] csmith at cbbc dot murdoch dot edu dot au
[2005-04-04 06:45 UTC] csmith at cbbc dot murdoch dot edu dot au
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 21:00:01 2025 UTC |
Description: ------------ Having this bug in 64 bit versions of php only. 32 bit versions work as expected. If you create an array with large integers as the keys, serialize the array, and unserialize the array, (so you can pass it through a session) the array key value is not being type promoted to a data type that can store the large integer. Instead you get a different value back as the key after unserializing the array. This is happening with the 64 bit versions of 5.0.3 and 4.3.2. Reproduce code: --------------- $array["1234567891011"] = 'test'; print "The array:<br/>"; var_dump( $array); $array_serialized = serialize($array); $array_unserialized = unserialize($array_serialized); print "<br/>The unserialized array:<br/>"; var_dump($array_unserialized); Expected result: ---------------- The array: array(1) { [1234567891011]=> string(4) "test" } The unserialized array: array(1) { [1234567891011]=> string(4) "test" } *Note: this is what you get back in the 32 bit version of php. Actual result: -------------- The array: array(1) { [1234567891011]=> string(4) "test" } The unserialized array: array(1) { [1912277059]=> string(4) "test" } *Note: this is what you get back in the 64 bit version of php.