From 436d3010d7ae2b6b34b114f161f881a4a9ee7eac Mon Sep 17 00:00:00 2001 From: Mehdi Achour Date: Sun, 10 Jun 2007 22:32:35 +0000 Subject: [PATCH] WS, prepare for new doc style git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@237372 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/var/functions/isset.xml | 124 ++++++------- reference/var/functions/print-r.xml | 166 +++++++++--------- reference/var/functions/serialize.xml | 134 +++++++------- reference/var/functions/unserialize.xml | 156 ++++++++--------- reference/var/functions/unset.xml | 223 ++++++++++++------------ 5 files changed, 401 insertions(+), 402 deletions(-) diff --git a/reference/var/functions/isset.xml b/reference/var/functions/isset.xml index fd61a6b95e..20ced47613 100644 --- a/reference/var/functions/isset.xml +++ b/reference/var/functions/isset.xml @@ -1,42 +1,42 @@ - + - - - isset - Determine whether a variable is set - - - Description - - boolisset - mixedvar - mixedvar - ... - - - - Returns &true; if var exists; &false; otherwise. - - - If a variable has been unset with unset, it will no - longer be set. isset will - return &false; if testing a variable that has been set to &null;. Also - note that a &null; byte ("\0") is not equivalent to - the PHP &null; constant. - - - Warning - - isset only works with variables as passing anything - else will result in a parse error. For checking if - constants are set use the - defined function. - - - - - + + + isset + Determine whether a variable is set + + + Description + + boolisset + mixedvar + mixedvar + ... + + + + Returns &true; if var exists; &false; otherwise. + + + If a variable has been unset with unset, it will no + longer be set. isset will + return &false; if testing a variable that has been set to &null;. Also + note that a &null; byte ("\0") is not equivalent to + the PHP &null; constant. + + + Warning + + isset only works with variables as passing anything + else will result in a parse error. For checking if + constants are set use the + defined function. + + + + + ]]> - - - - - This also work for elements in arrays: - - + + + + + This also work for elements in arrays: + + ]]> - - - - - ¬e.language-construct; - - - See also empty, - unset, - defined, - the type comparison tables, - array_key_exists, - is_null, - and the error control - @ operator. - - - + + + + + ¬e.language-construct; + + + See also empty, + unset, + defined, + the type comparison tables, + array_key_exists, + is_null, + and the error control + @ operator. + + + + - - - print_r - - Prints human-readable information about a variable - - - - Description - - mixedprint_r - mixedexpression - boolreturn - - - - The return parameter was added in PHP 4.3.0 - - - - print_r displays information about a variable - in a way that's readable by humans. If given a string, - integer or float, the value itself will be - printed. If given an array, - values will be presented in a format that shows keys and - elements. Similar notation is used for objects. - print_r, var_dump and - var_export will - also show protected and private properties of objects with PHP 5. - - - Remember that print_r will move the array - pointer to the end. Use reset to bring - it back to beginning. - - - - + + + print_r + + Prints human-readable information about a variable + + + + Description + + mixedprint_r + mixedexpression + boolreturn + + + + The return parameter was added in PHP 4.3.0 + + + + print_r displays information about a variable + in a way that's readable by humans. If given a string, + integer or float, the value itself will be + printed. If given an array, + values will be presented in a format that shows keys and + elements. Similar notation is used for objects. + print_r, var_dump and + var_export will + also show protected and private properties of objects with PHP 5. + + + Remember that print_r will move the array + pointer to the end. Use reset to bring + it back to beginning. + + + + ]]> - - &example.outputs; - + + &example.outputs; + Array @@ -65,53 +65,53 @@ Array ) ]]> - - - - - If you would like to capture the output of print_r, - use the return parameter. If this parameter is set - to &true;, print_r will return its output, instead of - printing it (which it does by default). - - ¬e.uses-ob; - - - <parameter>return</parameter> parameter example - + + + + + If you would like to capture the output of print_r, + use the return parameter. If this parameter is set + to &true;, print_r will return its output, instead of + printing it (which it does by default). + + ¬e.uses-ob; + + + <parameter>return</parameter> parameter example + 'monkey', 'foo' => 'bar', 'x' => array ('x', 'y', 'z')); $results = print_r($b, true); //$results now contains output from print_r ?> ]]> - - - - - - If you need to capture the output of print_r with a - version of PHP prior to 4.3.0, use the - output-control functions. - - - - - Prior to PHP 4.0.4, print_r will continue forever - if given an array or object that - contains a direct or indirect reference to itself. An example - is print_r($GLOBALS) because - $GLOBALS is itself a global variable that - contains a reference to itself. - - - - See also ob_start, - var_dump and - var_export. - - - + + + + + + If you need to capture the output of print_r with a + version of PHP prior to 4.3.0, use the + output-control functions. + + + + + Prior to PHP 4.0.4, print_r will continue forever + if given an array or object that + contains a direct or indirect reference to itself. An example + is print_r($GLOBALS) because + $GLOBALS is itself a global variable that + contains a reference to itself. + + + + See also ob_start, + var_dump and + var_export. + + + + - - - serialize - - Generates a storable representation of a value - - - - Description - - stringserialize - mixedvalue - - - serialize returns a string containing a - byte-stream representation of value that - can be stored anywhere. - - - This is useful for storing or passing PHP values around without - losing their type and structure. - + + + serialize + + Generates a storable representation of a value + + + + Description + + stringserialize + mixedvalue + + + serialize returns a string containing a + byte-stream representation of value that + can be stored anywhere. + + + 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 all types, except the resource-type. + You can even serialize arrays that contain + references to itself. Circular references inside the array/object you + are serializeing will also be stored. Any other + reference will be lost. + + + 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. + + - To make the serialized string into a PHP value again, use - unserialize. serialize - handles all types, except the resource-type. - You can even serialize arrays that contain - references to itself. Circular references inside the array/object you - are serializeing will also be stored. Any other - reference will be lost. + This didn't work correctly until 4.0.7. - - 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. - - - - This didn't work correctly until 4.0.7. - - - - - In PHP 3, object properties will be serialized, but methods are - lost. That limitation was removed in PHP 4 as both properties - and methods are now restored. Please see the Serializing Objects - section of Classes and - Objects for more information. - - - It is not possible to serialize PHP built-in objects. - - - - - <function>serialize</function> example - + + + + In PHP 3, object properties will be serialized, but methods are + lost. That limitation was removed in PHP 4 as both properties + and methods are now restored. Please see the Serializing Objects + section of Classes and + Objects for more information. + + + It is not possible to serialize PHP built-in objects. + + + + + <function>serialize</function> example + ]]> - - - - - See Also: unserialize. - - - + + + + + See Also: unserialize. + + + + - - - unserialize - - Creates a PHP value from a stored representation - - - - Description - - mixedunserialize - stringstr - - - unserialize takes a single serialized - variable (see serialize) and converts it - back into a PHP value. The converted value is returned, and can - be a boolean, integer, float, - string, array or object. - In case the passed string is not unserializeable, &false; is returned and - E_NOTICE is issued. - - - - &false; is returned both in the case of an error and if unserializing - the serialized &false; value. It is possible to catch this special case by - comparing str with - serialize(false) or by catching the issued - E_NOTICE. - - - - unserialize_callback_func directive - - It's possible to set a callback-function which will be called, - if an undefined class should be instantiated during unserializing. - (to prevent getting an incomplete object "__PHP_Incomplete_Class".) - Use your &php.ini;, ini_set or &htaccess; - to define 'unserialize_callback_func'. Everytime an undefined class - should be instantiated, it'll be called. To disable this feature just - empty this setting. Also note that the directive - unserialize_callback_func directive became - available in PHP 4.2.0. - - - - 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 - + + + unserialize + + Creates a PHP value from a stored representation + + + + Description + + mixedunserialize + stringstr + + + unserialize takes a single serialized + variable (see serialize) and converts it + back into a PHP value. The converted value is returned, and can + be a boolean, integer, float, + string, array or object. + In case the passed string is not unserializeable, &false; is returned and + E_NOTICE is issued. + + + + &false; is returned both in the case of an error and if unserializing + the serialized &false; value. It is possible to catch this special case by + comparing str with + serialize(false) or by catching the issued + E_NOTICE. + + + + unserialize_callback_func directive + + It's possible to set a callback-function which will be called, + if an undefined class should be instantiated during unserializing. + (to prevent getting an incomplete object "__PHP_Incomplete_Class".) + Use your &php.ini;, ini_set or &htaccess; + to define 'unserialize_callback_func'. Everytime an undefined class + should be instantiated, it'll be called. To disable this feature just + empty this setting. Also note that the directive + unserialize_callback_func directive became + available in PHP 4.2.0. + + + + 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 + ]]> - - - - - - In PHP 3, methods are not preserved when unserializing a - serialized object. That limitation was removed in PHP 4 as both - properties and methods are now restored. Please see the Serializing Objects - section of Classes and - Objects or more information. - - - - - <function>unserialize</function> example - + + + + + + In PHP 3, methods are not preserved when unserializing a + serialized object. That limitation was removed in PHP 4 as both + properties and methods are now restored. Please see the Serializing Objects + section of Classes and + Objects or more information. + + + + + <function>unserialize</function> example + ]]> - - - - - See also serialize. - - - + + + + + See also serialize. + + + + - - - unset - Unset a given variable - - - Description - - voidunset - mixedvar - mixedvar - mixed... - - - - unset destroys the specified variables. Note - that in PHP 3, unset will always return &true; - (actually, the integer value 1). In PHP 4, however, - unset is no longer a true function: it is - now a statement. As such no value is returned, and attempting to - take the value of unset results in a parse - error. - - - - <function>unset</function> example - + + + unset + Unset a given variable + + + Description + + voidunset + mixedvar + mixedvar + mixed... + + + unset destroys the specified variables. Note + that in PHP 3, unset will always return &true; + (actually, the integer value 1). In PHP 4, however, + unset is no longer a true function: it is + now a statement. As such no value is returned, and attempting to + take the value of unset results in a parse + error. + + + + <function>unset</function> example + ]]> - - - - - - It is possible to unset even object properties visible in current context. - - - - The behavior of unset inside of a function - can vary depending on what type of variable you are attempting to - destroy. - - - If a globalized variable is unset inside of - a function, only the local variable is destroyed. The variable - in the calling environment will retain the same value as before - unset was called. - - + + + + + + It is possible to unset even object properties visible in current context. + + + + The behavior of unset inside of a function + can vary depending on what type of variable you are attempting to + destroy. + + + If a globalized variable is unset inside of + a function, only the local variable is destroyed. The variable + in the calling environment will retain the same value as before + unset was called. + + ]]> - - - - &example.outputs; - - - + + + + &example.outputs; + + + - - - - - If you would like to unset a global variable - inside of a function, you can use - the $GLOBALS array to do so: - - + + + + + If you would like to unset a global variable + inside of a function, you can use + the $GLOBALS array to do so: + + ]]> - - - - - If a variable that is PASSED BY REFERENCE is - unset inside of a function, only the local - variable is destroyed. The variable in the calling environment - will retain the same value as before unset - was called. - - + + + + + If a variable that is PASSED BY REFERENCE is + unset inside of a function, only the local + variable is destroyed. The variable in the calling environment + will retain the same value as before unset + was called. + + ]]> - - - - &example.outputs; - - - + + + + &example.outputs; + + + - - - - - If a static variable is unset inside of a - function, unset destroys the variable only in the - context of the rest of a function. Following calls will restore the - previous value of a variable. - - + + + + + If a static variable is unset inside of a + function, unset destroys the variable only in the + context of the rest of a function. Following calls will restore the + previous value of a variable. + + ]]> - - - - &example.outputs; - - - + + + + &example.outputs; + + + - - - - - ¬e.language-construct; - - - See also isset, - empty, and - array_splice. - - - + + + + + ¬e.language-construct; + + + See also isset, + empty, and + array_splice. + + +