emptyDetermine whether a variable is empty
&reftitle.description;
boolemptymixedvar
Determine whether a variable is considered to be empty. A variable is considered empty if it does not exist or if its value equals &false;. empty does not generate a warning if the variable does not exist.
&reftitle.parameters;
var
Variable to be checked
No warning is generated if the variable does not exist.
That means empty is essentially the
concise equivalent to !isset($var) || $var == false.
&reftitle.returnvalues;
Returns &true; if var does not exist or has a value that is empty or equal to zero,
aka falsey, see conversion to boolean.
Otherwise returns &false;.
&reftitle.examples;
A simple empty / isset
comparison.
]]>
empty on String Offsets
]]>
&example.outputs;
&reftitle.notes;
¬e.language-construct;
When using empty on inaccessible object properties,
the __isset()
overloading method will be called, if declared.
&reftitle.seealso;
isset__isset()unsetarray_key_existscountstrlenThe type comparison tables