Home >Backend Development >PHP Problem >Is php an interpreted language?
Is PHP an interpreted language or a compiled language? Let’s first take a look at the development history of computer languages:
First generation: machine language, all of which are 01010 binary codes, which can be directly recognized by computers and have the highest operating efficiency, but are difficult to program and remember. Difficult to distinguish, poor portability!
Second generation: Assembly language is actually a symbolic machine language, which increases the readability of programming. It is still a low-level language in nature. Assembly language must go through an assembly program (converted into binary) before the computer can execute it
The third generation: high-level language is a program written in natural language and mathematical language that is close to human beings. Computers cannot directly recognize it and must be translated before it can be executed!
Two ways of computer language translation:
Compiled type: translate first and then execute, first form an executable file, such as one ending in .exe, if you want to execute 100 times, you only need to translate once!
Interpretation type: execute while translating. If you want to execute 100 times, you need to translate 100 times!
(recommended learning, PHP video tutorial)
PHP is an interpreted language!
However, in order to improve the efficiency of code execution, PHP will perform a pre-compilation in the PHP core engine before execution! The purpose of precompilation is not to allow the computer to execute it directly, but to allow the PHP interpreter to execute it directly!
The above is the detailed content of Is php an interpreted language?. For more information, please follow other related articles on the PHP Chinese website!