Home > Article > Backend Development > PHP execution process, php execution_PHP tutorial
The source code of any language cannot be directly executed by the computer. It needs to be converted into machine instructions that the computer can recognize.
PHP is also a high-level language and requires compilation (interpretation)
PHP parsing process:
1. Request source code, perform lexical analysis and syntax analysis.
Lexical analysis mainly reads and judges the words in the source code one by one. During lexical analysis, if there is an error, an error will be reported. Compilation error.
Grammar analysis, mainly to determine whether the grammatical structure is correct. For example: whether the process control structure is completed.
Result: executable machine code
2. Execution. During execution, it mainly operates on memory. Errors may also occur during execution. At this time, the error attribute execution error occurs.
Result: pure html code.
Illustration: