#46882 [Opn]: Serialize / Unserialize missbehaviour under OS with different bit numbers
| From: | max at phoenixweb dot it | Date: | Tue, 16 Dec 2008 18:29:35 +0000 |
| Subject: | #46882 [Opn]: Serialize / Unserialize missbehaviour under OS with different bit numbers | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-1644@lists.php.net to get a copy of this message | ||
ID: 46882
User updated by: max at phoenixweb dot it
Reported By: max at phoenixweb dot it
Status: Open
Bug Type: Documentation problem
Operating System: Centos 5.2 x86 64bit
PHP Version: 5.2.8
New Comment:
I love you!!!!!!!
:)
Previous Comments:
------------------------------------------------------------------------
[2008-12-16 18:25:17] mattwil@php.net
I'd agree that it's a bug... And I'm surprised *I* didn't catch this
one back when I was looking into other number-related stuff. :-)
Patches for all 3 branches:
http://realplain.com/php/bug46882.diff
http://realplain.com/php/bug46882_5_3.diff
http://realplain.com/php/bug46882_5_2.diff
Commit?
------------------------------------------------------------------------
[2008-12-16 18:13:12] max at phoenixweb dot it
WDDX is the best solutions to speak across different programming
languages.
But we are talking about 2 system serving PHP (not one PHP and another
JAVA)!
That should speak using PHP serialization of PHP objects.
PHP is compatible with differents PHP server by using WDDX but cannot
communicate with others PHP server by using its native way to serialize
(this seems to me a little bit silly).
But i won't ask for a personal solution just for my problem, consider
the bug from another point of view: what about an upgrade of the current
system to a system that run more than 4Gb of RAM.
Should I trash all the data of my Sql stored as a SERIALIZED
object????
I think this is silly.
By the way i'm fixing this by forcing casting floats for every int on
the 64bit before serialize.
------------------------------------------------------------------------
[2008-12-16 17:57:07] jani@php.net
serialize() is not meant for passing data between systems. There are
other methods for that. (wddx for example)
------------------------------------------------------------------------
[2008-12-16 15:26:18] max at phoenixweb dot it
But this is a problem.
Serialize is needed to store PHP object as a string. Is this correct?
There are a lot of possibility of needed an object as a string, like
complex data storage, and pass data from a server to another server.
If the data is not unserializable from a different server, it's
completely useless.
When i'll upgrade my server to 12Gb of RAM (needing a 64bit OS), i'll
have to trash all the data stored with SERIALIZE on my MySqls?
I don't think that the correct way is just to add a comment to the
current documentation.
I think this should be consider a bug, cause SERIALIZE / UNSERIALIZE is
used to storage data and pass it across servers, so must be compliant
with the problems of differents OS system behaviours.
------------------------------------------------------------------------
[2008-12-16 15:13:54] crrodriguez at opensuse dot org
This behavior is expected, but the documentation of serialize() does
not mention it, this is a documentation 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/46882
--
Edit this bug report at http://bugs.php.net/?id=46882&edit=1