|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-11-27 05:57 UTC] dmirand at abelia-decors dot com
Description:
------------
With objects storing an array with key values >= 2e31
(2147483648), these keys are altered after a serialize +
unserialize.
Occurs only on 64bit systems.
Reproduce code:
---------------
class Test {
var $arr = array() ;
function define_tab() {
$noscde = "5000000000" ;
$this->arr[$noscde]['noscde'] = $noscde ;
}
function get_tab() { return $this->arr; }
}
$obj = new Test() ;
$obj->define_tab() ;
print_r( $obj->get_tab() ) ;
$pok = serialize( $obj ) ;
$obj = unserialize( $pok ) ;
print_r( $obj->get_tab() ) ;
Expected result:
----------------
Array ( [5000000000] => Array ( [noscde] => 5000000000 ) )
Array ( [5000000000] => Array ( [noscde] => 5000000000 ) )
Actual result:
--------------
Array ( [5000000000] => Array ( [noscde] => 5000000000 ) )
Array ( [705032704] => Array ( [noscde] => 5000000000 ) )
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 14:00:01 2025 UTC |
Now with lastest CVS snapshot : array(1) { [5000000000]=> array(1) { ["noscde"]=> string(10) "5000000000" } } array(1) { [5000000000]=> array(1) { ["noscde"]=> string(10) "5000000000" } } Seems fixed now. Thanks !