#30917 [NoF->Opn]: Wrong keys in serialized obj's array

From: Date: Sun, 30 Jan 2005 14:51:32 +0000
Subject: #30917 [NoF->Opn]: Wrong keys in serialized obj's array
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-73069@lists.php.net to get a copy of this message
 ID:               30917
 User updated by:  dmirand at abelia-decors dot com
 Reported By:      dmirand at abelia-decors dot com
-Status:           No Feedback
+Status:           Open
 Bug Type:         Class/Object related
 Operating System: Linux (64bit only!)
 PHP Version:      4.3.9
 New Comment:

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 !


Previous Comments:
------------------------------------------------------------------------

[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


Thread (6 messages)

« previous php.bugs (#73069) next »