From 7a1cff916c228b5a4fbb1492261685547ca43b43 Mon Sep 17 00:00:00 2001 From: Daniel Beckham Date: Fri, 18 May 2001 02:23:42 +0000 Subject: [PATCH] added notes about serializing objects in php4 and added links to the new serialization section of oop.xml git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@47746 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/var.xml | 41 +++++++++++++++++++++++++++++++++-------- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/functions/var.xml b/functions/var.xml index a1aa242259..aefbd9645f 100644 --- a/functions/var.xml +++ b/functions/var.xml @@ -883,14 +883,23 @@ print_r ($a); This is useful for storing or passing PHP values around without losing their type and structure. - - To make the serialized string into a PHP value again, use - unserialize. Serialize - handles the types integer, double, - string, array (multidimensional) and - object (object properties will be serialized, but - methods are lost). - + + To make the serialized string into a PHP value again, use + unserialize. Serialize + handles the types integer, double, + string, array (multidimensional) and + object. + + + + In PHP 3, object properties will be serialized, but methods are + lost. PHP 4 removes that limitation and restores both properties + and methods. Please see the Serializing Objects + section of Classes and + Objects for more information. + + <function>Serialize</function> example @@ -913,6 +922,9 @@ if (!odbc_execute ($stmt, &$sqldata)) { + + See Also: unserialize. + @@ -1019,6 +1031,16 @@ 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. + + <function>Unserialize</function> example @@ -1044,6 +1066,9 @@ if (!odbc_execute ($stmt, &$sqldata) || !odbc_fetch_into ($stmt, &$tmp)) + + See Also: serialize. +