4 ms·
The PHP Wikipedia page seems to argue that the most popular implementation, Zend, is an interpreter. https://en.wikipedia.org/wiki/PHP#Implementations https://
by jayd16 6y ago
The PHP Wikipedia page seems to argue that the most popular implementation, Zend, is an interpreter.
https://en.wikipedia.org/wiki/PHP#Implementations https://en.wikipedia.org/wiki/PHP#Implementations
- btilly 6y agoIt argues that it operates as an interpreter, in exactly the way that I described. From your link, The Zend Engine compiles PHP source code on-the-fly into an internal format that it can execute, thus it works as an interpreter. In other works at startup itreads code, compiles to an internal form of byte code, and from then on it executes that. So it works as an interpreter (you give it code, it runs). But internally it does not go line by line as you go. As a simple demonstration, a syntax error on line 10 of a PHP script will keep it from executing code on line 5. By contrast a syntax error on line 10 of a Bash script will not keep it from having executed line 5 first.
- girvo 6y agoYou can examine and dump the byte code from the runtime with phpdbg — it basically acts as a compiler to byte code on startup. Of course because it’s also very dynamic, the lines are blurred, imo