Edit report at https://bugs.php.net/bug.php?id=64146&edit=1
ID: 64146
Comment by: gm dot outside+php at gmail dot com
Reported by: slusarz at curecanti dot org
Summary: serialize incorrectly saving objects when they are
cloned
Status: Closed
Type: Bug
Package: Variables related
Operating System: Linux
PHP Version: 5.4.11
Block user comment: N
Private report: N
New Comment:
PHP 5.5.7 (the latest at this moment) fails its testsuite on a 32-bit architecture on this bug. The
reproduction build is very simple: ./configure --disable-all && make && make test .
According to Remi Collet this has started with PHP 5.5.5 and affects only 32-bit systems while
64-bit systems pass the test. The latest reply on the PHP development list I found was from Michael
Wallner saying that he was going to look into the issue:
http://permalink.gmane.org/gmane.comp.php.devel/82473
Well, the issue is still there, so the bug is not properly solved, IMO.
Below is the content of ext/standard/tests/serialize/bug64146.diff on my 32-bit system after the
failure of the test:
===
$ cat ext/standard/tests/serialize/bug64146.diff003+
004+ Notice: Trying to get property of non-object in
/usr/src/php-5.5.7/ext/standard/tests/serialize/bug64146.php on line 49
005+
003- 2
$
===
Previous Comments:
------------------------------------------------------------------------
[2013-10-04 14:18:01] mike@php.net
Automatic comment on behalf of mike
Revision: http://git.php.net/?p=php-src.git;a=commit;h=8973390541faaadfdfc0f838421f037060188e5e
Log: fix bug #64146 (serialize incorrectly saving objects when they are cloned)
------------------------------------------------------------------------
[2013-02-07 22:58:23] mike@php.net
Using zend_objects_get_address() instead of the object handle fixes; but triggers
bug #62836
------------------------------------------------------------------------
[2013-02-07 22:57:27] mike@php.net
The following patch has been added/updated:
Patch Name: zend_objects_get_address
Revision: 1360277847
URL: https://bugs.php.net/patch-display.php?bug=64146&patch=zend_objects_get_address&revision=1360277847
------------------------------------------------------------------------
[2013-02-07 21:35:26] mike@php.net
Obviously a flaw in the way an object is identified in the engine/in the
serializer.
Since the cloned objects only live for the time of serialization, both have the
same object handle and will be identified as the *same*.
Not sure why unserialize barfs on it, though.
------------------------------------------------------------------------
[2013-02-07 19:37:35] nikic@php.net
@slusarz: Github changed the Gist URLs to include the owner's name too. I guess they
didn't consider users having number-names while doing that ^^
------------------------------------------------------------------------
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
https://bugs.php.net/bug.php?id=64146--
Edit this bug report at https://bugs.php.net/bug.php?id=64146&edit=1