I believe you often see a comparison of some PHP applications, said to replace strlen () with Isset (), isset than strlen execution speed and so on.
Example:
if (Isset ($username [5])) {
The username is at least six characters long.
}
The reason is that isset is a language structure, and strlen is a function. What is the language structure? Is it different from the function?
1. What are language structures and functions
Language structure: is the PHP language keywords, language grammar part; it can not be defined by the user or added to the language extension or library; it can have or can have no variables and return values.
Function: consists of blocks of code that can be reused.
2. Why language structure is faster than function
The reason is that in PHP, the function must first be decomposed into the language structure of the PHP parser, so there is this visible, the function is more than the language structure of a layer of parser parsing. This can be better understood as
What language structure is faster than a function.
3. Differences in language structure and functions
Language structure is faster than corresponding function function
Language structure in error processing is relatively robust, because it is a language keyword, so there is no re-processing links
The language structure cannot be disabled in configuration items (php.ini), and functions can.
The language structure cannot be used as a callback function
4. List of language structures
Echo ()
Print (), yes, it's a language structure
Die ()
Isset (): Only for variables
Unset ()
Include (), no include_once ()
Require (), no require_once ()
Array ()
List ()
Empty (): Only for variables
Isset () returns TRUE in the following cases:
$var = "";
$var = Array ();
$var = 0;
$var = false;
So far: Only NULL is assigned or not assigned, it is recommended to use empty