Let's first review empty and isset empty-check whether a variable is empty "", 0, "0", NULL, FALSE, array (), var $ var; objects without any attributes will be considered empty. If var is empty, TRUE isset is returned to check whether the variable is set and whether the detection variable is set, and not NULL. That is, if the variable is not set, false is returned. If the variable is NULL, false is returned. php manual has clearly explained the result. If the variable is not set, what is the result returned by empty? [Php] var_dump (empty ($ undefined); the result is: bool (true) can detect whether the empty variable is set. So should we use empty instead of isset? I think isset should be used only to judge whether a variable is stored or not, because the meaning of isset is clear, that is, it is used to facilitate reading the code. You can use [php] if (! Empty ($ var) replaces if (isset ($ var )&&! Empty ($ var) if (! Empty ($ var) replaces if (isset ($ var )&&! Empty ($ var) when you want to determine whether a variable is NULL, you must not use isset. Next, let's look at the performance of isset and empty? In fact, the performance of isset and empty is very good, with little difference. One more thing is that they are all statements, not functions. I want to take a look at the specific content in this regard, you can see that the statement isset and is_null in this article cannot be called by variable functions. In addition, isset and empty cannot accept the return values of functions as parameters, for example, [php] empty (intval ('3'); // Fatal error: can't use function return value in write context empty (intval ('3'); // Fatal error: Can't use function return value in write context however, currently, the latest PHP5.5 release supports this feature, that is, it can use any expression in empty: [php] function always_false () {return false ;} if (empty (always_false () {echo "This will be printed. \ n ";}function always_false () {return false;} if (empty (always_false () {echo" This will be printed. \ n ";} will output: This will be printed.