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 ($user)) {
Do some thing
}
The reason is that isset is a language structure, and strlen is a function. And Echo is a language structure, not 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. From the source point of view, that is, based on the Zend engine base to achieve, Ext expansion library functions are implemented.
2, why the language structure is faster than the function of the reason is in PHP, the function must first be the PHP parser (Zend Engine) decomposition into a language structure, so there is this visible, function than the language structure more than a layer of parser parsing. This can be better understood, what language structure is faster than the function.
3, the language structure and function of the different language structure than the corresponding function of the function of the fast language structure is relatively robust in error handling, because it is a language keyword, so there is no re-processing link language structure can not be disabled in the configuration item (php.ini), function. The language structure cannot be used as a callback function
4. List of language structures
Echo ()
Print ()
Die ()
Isset ()
Unset ()
Include (), note that include_once () is a function
Require (), note that require_once () is a function
Array ()
List ()
Empty ()