#32976 [Opn->Fbk]: (Un)serialize destroys references in a tree like class structure

From: Date: Sun, 08 May 2005 02:37:28 +0000
Subject: #32976 [Opn->Fbk]: (Un)serialize destroys references in a tree like class structure
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-78762@lists.php.net to get a copy of this message
ID: 32976 Updated by: sniper@php.net Reported By: a_wizzard at hotmail dot com -Status: Open +Status: Feedback Bug Type: Scripting Engine problem Operating System: Gentoo Linux 2.6 PHP Version: 5.0.4 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php5-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.0-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2005-05-08 04:01:45] a_wizzard at hotmail dot com Description: ------------ When designing a file browser I discovered the PHP 5 does not handle the unserialization of references correctly. I'm using a tree like structure in which every node has a reference to its parents and its children. When deserializing, the reference becomes corrupted (or rather it disappears). Look at the url below: http://sportlaan.adsl.utwente.nl/webstorage/index.php The first time a session is created with the default tree, notice that the nodes link to eachother. When you click on the upload link at the left directory tree (below the debug output) you'll see the script stops with an error complaining about its parent not being an object. This should be the exact same structure as when starting the script. Btw, kill the session using: http://sportlaan.adsl.utwente.nl/webstorage/index.php?clear=1 I've tested the code on the PHP 4.3.*something* engine as well and that one handles it perfectly - the references are restored using the serialize and unserialize calls. Btw, I saw the bug report on: http://bugs.php.net/bug.php?id=27120 This seems (by description) pretty much the same bug as reported before - what puzzles me though is that the old bug is from the old PHP5 CVS version whereas I am already using the stable 5.0.4. So its either not the same bug or the bug reappeared again... Reproduce code: --------------- See description Expected result: ---------------- See description Actual result: -------------- See description ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32976&edit=1

« previous php.bugs (#78762) next »