ID: 17490 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Feedback Bug Type: Strings related Operating System: linux rh7.2 PHP Version: 4.2.1 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php4-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-latest.zip This bug may be related to locale issues that were addressed in the latest CVS. Previous Comments: ------------------------------------------------------------------------ [2002-09-25 06:34:03] [EMAIL PROTECTED] Not session related, reclassified. ------------------------------------------------------------------------ [2002-09-16 09:28:55] [EMAIL PROTECTED] My problem is not improperly using __sleep. Referencing complexity definitely seems to be part of the problem. I am serializing multiple groups of objects for different purposes. Some of my object structures have relatively simple referencing complexity, and I can get away with using the standard serializer on those objects. Others are far more free form and complicated, and I cannot safely use the standard serializer on those objects. At one point, I created a failure in my "simple" objects (the ones using the standard serializer) when I tried to add an associative array of numeric arrays of objects to the top-level object being serialized. The objects in the numeric array pointed back to the top-level object containing the associative array. Old referencing structure ... object A -member is-> associative array -elements are-> arrays -elements are-> objects -points to-> object A I resolved this problem by removing the associative array from the equation and creating dynamically named variables to directly contain the object arrays. New referencing structure ... object A -members are-> arrays -elements are-> objects -points to-> object A ------------------------------------------------------------------------ [2002-09-09 13:09:57] [EMAIL PROTECTED] i'm not sure about the others who were having similiar problems, but the problem i was having has been solved. it turned out to be a misuse of the __sleep() method in my base object. i mistakenly thought the method should have been unsetting variables not to be serialized, when in fact it needed to return an array of variables TO serialize. once this mistake was caught and fixed, serialization of my objects started working. it would still seem to be a bug in PHP, however, to have the actual unserialize call fail directly after a serialize call. this should give a good starting point for the developers to look at, and others who were having a similiar problem can check their code. ------------------------------------------------------------------------ [2002-08-22 14:17:58] [EMAIL PROTECTED] As others have said, the problem seems linked to the complexity of the variable being serialized and not strictly the size of the result string. Of note, the WDDX serializer serialized and unserialized my object array without any problems, but its lack of reference support may account for that. I actually needed references preserved, so for now I am using a combination of pre-serialization and post-unserialization processing in combination with WDDX as a work around. ------------------------------------------------------------------------ [2002-08-22 00:38:47] [EMAIL PROTECTED] I just downloaded, compiled, and restarted Apache 1.3.26 with the latest php4-latest.tar.gz and no change. In fact, it would seem that there is now a regression - a 10 element array with objects in each index now won't even serialize. In order not to clutter the bug DB, the following link should help you to see the issue and data structures at play here: http://www.green-ant.com/serialize-issues.php I included the Debug::Debug() function, but not the base classes for NDA reasons. Since it's the data that gets serialized, not the functions, that shouldn't be a problem. ;) ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/17490 -- Edit this bug report at http://bugs.php.net/?id=17490&edit=1