diff --git a/functions/var.xml b/functions/var.xml index c96d3c6f58..ed1b07b604 100644 --- a/functions/var.xml +++ b/functions/var.xml @@ -48,13 +48,26 @@ print $double_value_of_var; // prints 122.34343 Description - int empty + boolean empty mixed var + + + empty is a language construct. + + - Returns false if var is set and has a - non-empty or non-zero value; true otherwise. + This is the opposite of + (boolean) var, + exept that no warning is generated when the variable is not set. + See converting + to boolean for more information. + + + + $var = 0; @@ -68,12 +81,13 @@ if (!isset($var)) { // evaluates false } - + 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 @@ -103,7 +117,7 @@ if (!isset($var)) { // evaluates false Possibles values for the returned string are: - "boolean" + "boolean" (since PHP 4) "integer" @@ -121,13 +135,16 @@ if (!isset($var)) { // evaluates false "object" - "resource" + "resource" (since PHP 4) + + + "NULL" (since PHP 4) "user function" (PHP 3 only, deprecated) - "unknown type" + "unknown type"