#17490 [Com]: serialize() generates a string that unserialize() can't handle

From: Date: Thu, 22 Aug 2002 04:38:48 +0000
Subject: #17490 [Com]: serialize() generates a string that unserialize() can't handle
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17495@lists.php.net to get a copy of this message
ID: 17490 Comment by: mark.hershenson@aresdirect.com Reported By: weyrick@roadsend.com Status: Feedback Bug Type: Session related Operating System: linux rh7.2 PHP Version: 4.2.1 New Comment: 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. ;) Previous Comments: ------------------------------------------------------------------------ [2002-08-21 21:08:11] sniper@php.net 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 ------------------------------------------------------------------------ [2002-08-21 14:53:02] mark.hershenson@aresdirect.com [It would seem that this and bug #18404 are related, in case anyone wanted to combine them.] I am currently debugging an issue which I am finding hard to find which centers on trying to serialize and deserialize very complex objects which, when serialized, are around 580k in size. It's all part of a custom session handler. However, I have run into this particular problem myself, and it is causing me fits. Even if I break some of the items into their component parts, the serialization will fail, but it would appear it is the complexity of the objects, not the size of the string which seems to determine failure. To get around the issue, I have had to write a custom serializer, but am now running into a PHP userland limitation of not being able to cast a stdClass to the desired class without having to call the constructor of the destination class without knowing the variables to pass to it. Considering the ease of use of sessions and the serialize/deserialize functions, shouldn't this be more highly assigned in the outstanding bug database? I can volunteer whatever time is necessary to get this fixed, but will definitely need help from those who know how the engine works better than I. ======= My configure and system info: './configure' '--with-mysql=/usr/local/mysql' '--enable-track-vars' '--enable-inline-optimizations' '--enable-wddx' '--with-dom=/usr/local/libxml' '--with-dom-xslt=/usr/local/libxslt' '--with-dom-exslt=/usr/local/libxslt' '--with-zlib-dir' '--with-apxs=/opt/apache13/sbin/apxs' '--quiet' RedHat 7.3 / Linux aries.aresdirect.com 2.4.7-10 #1 Thu Sep 6 17:27:27 EDT 2001 i686 unknown [markhers@aries ~]$ uname -a Linux aries.aresdirect.com 2.4.7-10 #1 Thu Sep 6 17:27:27 EDT 2001 i686 unknown [markhers@aries ~]$ gcc -v Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/2.96/specs gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-98) From phpinfo(): API Versions: PHP: 20020307 PHP Extension: 20020429 Zend Extension: 20020731 Server sig: Apache/1.3.26 (Unix) PHP/4.3.0-dev ---------------- -- mjh ------------------------------------------------------------------------ [2002-07-29 10:23:01] weyrick@roadsend.com reopen ------------------------------------------------------------------------ [2002-07-23 14:18:46] dougqh@incogen.com weyrick, You may want to set the status of the bug back to Open. I would do it, but it seems only the original submitter can change the status. Just a suggestion. ------------------------------------------------------------------------ [2002-07-23 13:28:19] weyrick@roadsend.com just another comment, i'm also still having the same problem, and i've been unable to find a solution. it only seems to happen on complex objects, so a "simple test case" isn't easy to create... ------------------------------------------------------------------------ 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

« previous php.bugs (#17495) next »