From d0f53268c6f6113c20af4970f5f88efbfb97ffc2 Mon Sep 17 00:00:00 2001 From: Sebastian Mendel Date: Wed, 21 Mar 2007 14:17:20 +0000 Subject: [PATCH] added explanation/notice about unset variable behavior --- libraries/core.lib.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libraries/core.lib.php b/libraries/core.lib.php index da93ea851..598b85b36 100644 --- a/libraries/core.lib.php +++ b/libraries/core.lib.php @@ -64,6 +64,19 @@ function PMA_ifSetOr(&$var, $default = null, $type = 'similar') * PMA_isValid($_REQUEST['doit'], 'identical', 'true'); // true * * + * 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: + * + * // $var is not set + * isset($var); // false + * functionCallByReference($var); // false + * isset($var); // true + * functionCallByReference($var); // true + * + * + * to avoid this we set this var to null if not isset + * * @todo create some testsuites * @todo add some more var types like hex, bin, ...? * @uses is_scalar()