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