diff --git a/reference/var/functions/empty.xml b/reference/var/functions/empty.xml index a68906037d..6718bdb184 100644 --- a/reference/var/functions/empty.xml +++ b/reference/var/functions/empty.xml @@ -1,10 +1,10 @@ - + empty - Determine whether a variable is set + Determine whether a variable is empty Description @@ -12,49 +12,63 @@ boolempty mixedvar - - - empty is a language construct. - - - ¬e.language-construct; - This is the opposite of + empty returns &false; if + var has a non-empty or non-zero value. In + otherwords, "", 0, + "0", &null;, &false;, array(), + var $var;, and objects with empty properties, are + all considered empty. &true; is returned if var + is not empty. + + + empty is the opposite of (boolean) var, except that no warning is generated when the variable is not set. See converting to boolean for more information. - - - - + + + + A simple <function>empty</function> / <function>isset</function> + comparison. + ]]> - + + + ¬e.language-construct; + + + + empty only checks variables as anything else will + result in a parse error. In otherwords, the following will not work: + empty(addslashes($name)). + + - Note that this is meaningless when used on anything which isn't a - variable; i.e. empty (addslashes ($name)) has - no meaning since it would be checking whether something which - isn't a variable is a variable with a &false; value. - - - - See also isset and - unset. + See also isset, + unset, + array_key_exists, + count, and + strlen.