From:             a_wizzard at hotmail dot com
Operating system: Gentoo Linux 2.6
PHP version:      5.0.4
PHP Bug Type:     Scripting Engine problem
Bug description:  (Un)serialize destroys references in a tree like class 
structure

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 bug report at http://bugs.php.net/?id=32976&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=32976&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=32976&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=32976&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=32976&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=32976&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=32976&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=32976&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=32976&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=32976&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=32976&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=32976&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=32976&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=32976&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=32976&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=32976&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=32976&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=32976&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=32976&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=32976&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=32976&r=mysqlcfg

Reply via email to