ID: 14266
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Debian Linux
PHP Version: 4.2.0-dev
New Comment:

Ok, I tested a little bit more
and found that when calling serialize() like serialize(&$x)
it works.
I know about leaks, but those leaks don't kill me (yet).

And btw. Circular references work as expected. There is 
nothing so "undefined" about them in php. They work quite 
logically.


Previous Comments:
------------------------------------------------------------------------

[2001-11-28 09:01:05] [EMAIL PROTECTED]

sorry, i wanted to write:
you realy should *NOT*...

------------------------------------------------------------------------

[2001-11-28 08:59:04] [EMAIL PROTECTED]

Behaviour of Circular / Selfreferencing objects is not defined. 

you could try to do a workarround 
by using defining __sleep() and __wakeup()
in your class, which are called when the object is serialized / unserialized, and 
could unset those self-references.

but you realy should do those.. if you dont destroy all of those references, you will 
get memory leaks!

regards, Peter Petermann

------------------------------------------------------------------------

[2001-11-28 08:43:47] [EMAIL PROTECTED]

I dont' agree. Circular refferences can happen with 
objects (using refferences). Sometimes they are 
intentional. And serialize() doesn't completely ignore 
this. Because it spits out:
O:8:"stdClass":1:{s:1:"x";O:8:"stdClass":1:{s:1:"x";R:2;}}

so it knows about circular refferences.

Now is there any reason why it doesn't generate instead 
something like this:

O:8:"stdClass":1:{s:1:"x";R:1;}

I would understand if it completely ignores circular 
references, but it doesn't. It just misbehaves.



------------------------------------------------------------------------

[2001-11-28 08:41:04] [EMAIL PROTECTED]

Your creating a reference to itself this is not allowed.

Therefore the bug is bogus, the behaviour is undefined.

- James

------------------------------------------------------------------------

[2001-11-28 08:38:38] [EMAIL PROTECTED]

Tested this with current cvs too. No better luck.
Original and unserialized objects have different 
representation in memory.


------------------------------------------------------------------------

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/?id=14266


Edit this bug report at http://bugs.php.net/?id=14266&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to