This section is in the php manual. "Because it is a language constructor rather than a function, it cannot be called by variable functions ." What does a language constructor mean. I don't quite understand this section in the php manual.
"Because it is a language constructor rather than a function, it cannot be called by variable functions ."
What does the language constructor mean. Not very clear
Reply content:
This section is in the php manual.
"Because it is a language constructor rather than a function, it cannot be called by variable functions ."
What does the language constructor mean. Not very clear
The "language construct" you mentioned is "language construct" in English. It is the meaning of a language. It is difficult to translate it into a language constructor. PHP hasecho
,print
,die
,require
And so on. Although they are used as functions, they are more similarif
,while
In this way, the control statement is not a function. That is, when the interpreter encounters:
print 'Hello world';
In such an expression, it is not converted into a function call, but directly mapped to a series of pre-defined operations. When using a language, you can add parentheses or do not add parentheses, but you must add parentheses when using a function.
The variable function you mentioned is "variable function". translating it into a variable function is also a little distorted) the term is translated according to the meaning of the adjective (variable. The Variable function in PHP is a function with the same name and value as the Variable if a pair of parentheses is added to the Variable. If the Variable is found, the interpreter tries to execute it. For example, there is a functionfoo()
You can call this function in the following way:
// Initialize a string variable $ func = 'foo'; // find the function with the same name as this string and execute it $ func ();
Therefore, the meaning of the sentence you mentioned is that using a variable function to call a language is not allowed. For example:
$ Func = 'print '; // This operation produces an exception, because print is not a function, but a component of the language $ func ('Hello World ');
When this code is executed, an exception occurs.print
Not defined.
Finally, we recommend that you read English documents mainly in English. The translation level and update speed of Chinese documents are usually poor.