#39635 [Com]: Better control for serialization (keyword for permit property serialization)
| From: | spam at thishell dot com | Date: | Thu, 25 Jan 2007 15:54:51 +0000 |
| Subject: | #39635 [Com]: Better control for serialization (keyword for permit property serialization) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-108052@lists.php.net to get a copy of this message | ||
ID: 39635
Comment by: spam at thishell dot com
Reported By: t dot prochazka at centrum dot cz
Status: Open
Bug Type: Feature/Change Request
Operating System: all
PHP Version: 5CVS-2006-11-26 (CVS)
New Comment:
While it is possible to exclude members from serialization using
__sleep(), it has downsides:
- Using get_object_vars($this) to return the members is extremely slow
- Manually maintaining an array with the members is error prone and can
be quite some work
A transient keyword to exclude members from serialization would make it
easier ...
Previous Comments:
------------------------------------------------------------------------
[2006-11-26 11:40:40] t dot prochazka at centrum dot cz
Description:
------------
PHP has no advanced support for serialization.
I think, that is problem, that PHP serialize all properties. What about
add single keyword (as transient) for property which can't be
serializable?
Example:
class Foo {
public $a;
public transient $b;
}
Description of Java transient keyword:
http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#78119
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39635&edit=1