Edit report at http://bugs.php.net/bug.php?id=36424&edit=1
ID: 36424 User updated by: mastabog at hotmail dot com Reported by: mastabog at hotmail dot com Summary: Serializable interface breaks object references Status: Bogus Type: Bug Package: Scripting Engine problem Operating System: * PHP Version: 5.2.14-dev Assigned To: helly New Comment: If you remove "implements Serializable" then it works as expected and the reproduce code shows that. Revealing the bug was what my report was about. It's a bug. It surprises me that nobody wants to fix it after more than 4 years ... apparently it's just me that considers this bug to be important which is why I still avoid using the Serializable interface altogether. It's unreliable. Previous Comments: ------------------------------------------------------------------------ [2010-05-20 16:09:10] [email protected] The reproduce code is wrong. Your code serializes everything on it's own, as you can see if you replace return $serialized; with $serialized = serialize($serialized); printf("serialized %s as '%s'\n", get_class($this), $serialized); return $serialized; Output: yes serialized A as 'a:0:{}' serialized A as 'a:0:{}' serialized B as 'a:1:{s:1:"A";C:1:"A":6:{a:0:{}}}' serialized C as 'a:2:{s:1:"A";C:1:"A":6:{a:0:{}}s:1:"B";C:1:"B":32:{a:1:{s:1:"A";C:1:"A":6:{a:0:{}}}}}' no ------------------------------------------------------------------------ [2010-03-02 00:31:36] mastabog at hotmail dot com Hi, I tested with the latest Linux source snapshot (php5.2-201003011530) and the bug is still there. I also tested the recently released 5.2.13 release and got the same result. Both Linux and Windows. Did you run the reproduce code from the first post above and got the expected result? The bug is definitely there in the snapshot I tested. I've been avoiding the Serializable interface ever since it got introduced due to this nasty bug. Could it please be fixed? It's growing old and strong :) Cheers ------------------------------------------------------------------------ [2010-02-28 15:36:46] [email protected] Please try using this snapshot: http://snaps.php.net/php5.2-latest.tar.gz For Windows: http://windows.php.net/snapshots/ ------------------------------------------------------------------------ [2010-02-27 02:30:14] mastabog at hotmail dot com I know it's been over 1 year since you asked me to try the latest CVS snapshot but ... ... the bug is still there in 5.2.12 (Windows)! Yuu can try the reproduce code from the first post. Can this be fixed please? ------------------------------------------------------------------------ [2008-11-10 01:00:00] 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". ------------------------------------------------------------------------ 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/bug.php?id=36424 -- Edit this bug report at http://bugs.php.net/bug.php?id=36424&edit=1
