Always forget the difference between these variables, refer to the next http://www.jb51.net/article/38020.htm, record the
Set several variables
<? $a $b false $c = "$d = 0 $e NULL $farray?>
The first is the empty var_dump output :
<?PHPVar_dump(Empty($a)); Var_dump(Empty($b)); Var_dump(Empty($c)); Var_dump(Empty($d)); Var_dump(Empty($e)); Var_dump(Empty($f)); ?>
The program output is:
BOOL (TRUE)
BOOL (TRUE)
BOOL (TRUE)
BOOL (TRUE)
BOOL (TRUE)
BOOL (TRUE)
Then the var_dump output of the isset:
var_dump (isset ( $a var_dump (isset ( $b var_dump (isset ( $c var_dump (isset ( $d var_dump (isset ( $e var_dump (isset ( $f ));
The output is:
Output
BOOL (FALSE)
BOOL (TRUE)
BOOL (TRUE)
BOOL (TRUE)
BOOL (FALSE)
BOOL (TRUE)
And finally the var_dump output of the is_null.
var_dump (is_null ( $a var_dump (is_null ( $b var_dump (is_null ( $c var_dump (is_null ( $d var_dump (is_null ( $e var_dump (is_null ( $f ));
The result of the output is:
BOOL (TRUE)
BOOL (FALSE)
BOOL (FALSE)
BOOL (FALSE)
BOOL (TRUE)
BOOL (FALSE)
This shows that empty () can be used to determine whether all data types are empty or false , and Is_null is basically the same as isset, and can only be used to determine if null and undefined .
PHP empty Isset is_null