From 906adbe7fac6ebbcb02dd0c9c39b59df9e20d27b Mon Sep 17 00:00:00 2001 From: John Coggeshall Date: Wed, 20 Nov 2002 02:45:02 +0000 Subject: [PATCH] Documented the __sleep and __wakeup member functions when serializing/unserializing objects in both function references. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@104987 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/var/functions/serialize.xml | 9 ++++++++- reference/var/functions/unserialize.xml | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/reference/var/functions/serialize.xml b/reference/var/functions/serialize.xml index a372b8acf0..25501e11b5 100644 --- a/reference/var/functions/serialize.xml +++ b/reference/var/functions/serialize.xml @@ -1,5 +1,5 @@ - + @@ -31,6 +31,13 @@ references to itself. References inside the array/object you are serializeing will also be stored. + + When serializing objects, PHP will attempt to call the member function +__sleep() prior to serialization. This is to allow the object to do any +last minute clean-up, etc. prior to being serialized. Likewise, when the +object is restored using unserialize the __wakeup() +member function is called. + + @@ -37,6 +37,7 @@ + If the variable being unserialized is an object, after successfully reconstructing the object PHP will automatically attempt to call the __wakeup() member function (if it exists). unserialize_callback_func example