#30917 [NEW]: Wrong keys in serialized obj's array

From: Date: Sat, 27 Nov 2004 04:57:11 +0000
Subject: #30917 [NEW]: Wrong keys in serialized obj's array
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-69506@lists.php.net to get a copy of this message
From: dmirand at abelia-decors dot com Operating system: Linux PHP version: 4.3.9 PHP Bug Type: *General Issues Bug description: Wrong keys in serialized obj's array 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 ) ) -- Edit bug report at http://bugs.php.net/?id=30917&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30917&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30917&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30917&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30917&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30917&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30917&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30917&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30917&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30917&r=support Expected behavior: http://bugs.php.net/fix.php?id=30917&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30917&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30917&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30917&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30917&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30917&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30917&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30917&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30917&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30917&r=mysqlcfg

« previous php.bugs (#69506) next »