Empty¶
Empty is a language structure, which determines whether a variable is empty.
A variable is considered empty if it does not exist or if its value equals false. This may overlap with the usage of isset().
empty()
has an error suppression feature, that masks various errors, such as undefined offset or undefined variables. Some other errors, like an invalid type as offset, are still reported.
<?php
// True
var_dump(empty($a));
$b = [];
// True
var_dump(empty($b));
?>
See also PHP isset() vs. empty() vs. is_null(), Avoiding empty() in PHP
Related : Language Construct, Isset, Null