ID:               30324
 Updated by:       [EMAIL PROTECTED]
 Reported By:      matthias dot hoseit at comline dot de
 Status:           Open
 Bug Type:         Feature/Change Request
-Operating System: Windows 2000
+Operating System: *
-PHP Version:      5.0.2
+PHP Version:      5.0.*
 New Comment:

serialize() works on internal classes. It doesn't work on virtual
properties and this problem usually occurs with internal classes.

What you want is more control over serialization. Eventually the
solution is a set of new magic callbacks 
function /* string */ __serialize()
static function /* instance */ __unserialize(string $data)

__serialze() would need to return the string used to recreate the
instance and __unserialize() would recreate it from the passed string.
We could also make __unserialize() a non static fucntion in which case
the instance would be created prior to calling the function. However
the static functionality allows much more flexibility. 

For example the static functionality allows instance creation through
factory methods and they could store the information needed to reread a
xml document or reopen a database connection.



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

[2004-10-04 17:00:56] matthias dot hoseit at comline dot de

Description:
------------
The function serialize() should work on internal classes like
DOMDocument. I my opinion this could be a nice Feature.

Best Regards Matthias Hoseit



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


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

Reply via email to