added explanation/notice about unset variable behavior

This commit is contained in:
Sebastian Mendel
2007-03-21 14:17:20 +00:00
parent 6b47ec1252
commit d0f53268c6

View File

@@ -64,6 +64,19 @@ function PMA_ifSetOr(&$var, $default = null, $type = 'similar')
* PMA_isValid($_REQUEST['doit'], 'identical', 'true'); // true * PMA_isValid($_REQUEST['doit'], 'identical', 'true'); // true
* </code> * </code>
* *
* NOTE: call-by-reference is used to not get NOTICE on undefined vars,
* but the var is not altered inside this function, also after checking a var
* this var exists nut is not set, example:
* <code>
* // $var is not set
* isset($var); // false
* functionCallByReference($var); // false
* isset($var); // true
* functionCallByReference($var); // true
* </code>
*
* to avoid this we set this var to null if not isset
*
* @todo create some testsuites * @todo create some testsuites
* @todo add some more var types like hex, bin, ...? * @todo add some more var types like hex, bin, ...?
* @uses is_scalar() * @uses is_scalar()