From f937fa85ca517d375e1489f168846bd1b0600fc5 Mon Sep 17 00:00:00 2001 From: Bernd Roemer Date: Mon, 10 Dec 2001 00:46:49 +0000 Subject: [PATCH] added describtion for unserialize_callback_function git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@64368 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/var.xml | 48 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/functions/var.xml b/functions/var.xml index ee79f2562e..3574a62352 100644 --- a/functions/var.xml +++ b/functions/var.xml @@ -1,5 +1,5 @@ - + Variable Functions Variables @@ -1150,16 +1150,42 @@ settype($bar, "string"); // $bar is now "1" (string) If an object was serialized, its methods are not preserved in the returned value. - - - In PHP 3, methods are not preserved when unserializing a - serialized object. PHP 4 removes that limitation and restores - both properties and methods. Please see the Serializing Objects - section of Classes and - Objects or more information. - - + + It's possible to set a callback-function which will be called, + if an undefined class should be instanciated during unserializing. + (to prevent getting an incomplete object "__PHP_Incomplete_Class".) + Use your php.ini, ini_set or .htaccess-file + to define 'unserialize_callback_func'. + Everytime an undefined class should be instanciated, it'll be called. + To disable this feature just empty this global variable. + + + unserialize_callback_func example + + + + + + + + + In PHP 3, methods are not preserved when unserializing a + serialized object. PHP 4 removes that limitation and restores + both properties and methods. Please see the Serializing Objects + section of Classes and + Objects or more information. + + <function>unserialize</function> example