#30917 [Opn->Csd]: Wrong keys in serialized obj's array
| From: | tony2001@php.net | Date: | Sun, 30 Jan 2005 14:59:08 +0000 |
| Subject: | #30917 [Opn->Csd]: Wrong keys in serialized obj's array | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-73070@lists.php.net to get a copy of this message | ||
ID: 30917
Updated by: tony2001@php.net
Reported By: dmirand at abelia-decors dot com
-Status: Open
+Status: Closed
Bug Type: Class/Object related
Operating System: Linux (64bit only!)
PHP Version: 4.3.9
New Comment:
Close it then.
Previous Comments:
------------------------------------------------------------------------
[2005-01-30 15:51:30] dmirand at abelia-decors dot com
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 !
------------------------------------------------------------------------
[2005-01-26 01:00:09] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2005-01-18 12:43:12] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
------------------------------------------------------------------------
[2005-01-18 12:42:43] sniper@php.net
Replace the print_r() with var_dump() please.
And paste the result you get.
------------------------------------------------------------------------
[2004-11-27 05:57:10] 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 ) )
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30917&edit=1