summaryrefslogtreecommitdiff
path: root/ext/spl/spl.php
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2005-03-09 01:21:04 +0000
committerMarcus Boerger <helly@php.net>2005-03-09 01:21:04 +0000
commitb06d0ef758a9b40f73513fd77fd6822958c9bb1a (patch)
treeafe384d9c94469bf8df22ff463fb8b3cde0dbcca /ext/spl/spl.php
parente90582a9904c66926bc691e4797dda6bd15574b3 (diff)
downloadphp-git-b06d0ef758a9b40f73513fd77fd6822958c9bb1a.tar.gz
Add description for interface Serializeable
Diffstat (limited to 'ext/spl/spl.php')
-rwxr-xr-xext/spl/spl.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/ext/spl/spl.php b/ext/spl/spl.php
index b3c699a4d2..cac58446e7 100755
--- a/ext/spl/spl.php
+++ b/ext/spl/spl.php
@@ -435,6 +435,33 @@ interface Countable
function count();
}
+/** @ingroup ZendEngine
+ * @brief Interface for customized serializing
+ * @since 5.1
+ *
+ * Classes that implement this interface no longer support __sleep() and
+ * __wakeup(). The method serialized is called whenever an instance needs to
+ * be serialized. This does not invoke __destruct() or has any other side
+ * effect unless programmed inside the method. When the data is unserialized
+ * the class is known and the appropriate unserialize() method is called as a
+ * constructor instead of calling __construct(). If you need to execute the
+ * standard constructor you may do so in the method.
+ */
+interface Serializeable
+{
+ /**
+ * @return string representation of the instance
+ */
+ function serialize();
+
+ /**
+ * @note This is a constructor
+ *
+ * @param $serialized data read from stream to construct the instance
+ */
+ function unserialize($serialized);
+}
+
/** @ingroup SPL
* @brief An Array wrapper
* @since PHP 5.0