Is php interpreted or compiled?
PHP is an interpreted language. The PHP code is interpreted into opcode and then handed over to the Zend engine for execution. Using APC to cache opcode reduces the time required for PHP to interpret it as opcode.
Interpreted language
The source program is precompiled into an intermediate language before the program is run, and then the intermediate language is executed by the interpreter each time the interpreted language program is executed. All need to be compiled once, so the running efficiency of interpreted language programs is usually low, and it cannot run independently from the interpreter.
Main features
(1) Open source and free nature
Since the source code of the PHP interpreter is public, the security factor is relatively high High-end websites can change the PHP interpreter themselves. In addition, the use of the PHP runtime environment is also free.
(2) Quickness
PHP is a language that is very easy to learn and use. Its syntax features are similar to C language, but it does not have the complex address operations of C language. Moreover, the concept of object-oriented is added, and it has concise grammatical rules, making it very simple to operate and edit, and very practical.
(3) Extensibility of database connections
PHP can establish connections with many mainstream databases, such as MySQL, ODBC, Oracle, etc. PHP uses different compiled functions to establish connections with these databases For connection purposes, PHPLIB is a commonly used base library provided for general transactions.
(4) Use process-oriented and object-oriented together
In the use of PHP language, you can use process-oriented and object-oriented respectively, and you can mix PHP process-oriented and object-oriented together. , which is something that many other programming languages cannot do.
For more PHP knowledge, please visit PHP Chinese website!
The above is the detailed content of Is php interpreted or compiled?. For more information, please follow other related articles on the PHP Chinese website!