PHP interpreter Opcache

My information:

PHP is a programming language which uses an interpreter.

The interpreter is a compiled software between the source code and the machine.

It reads and analyses the source code at runtime and starts its own Subroutines based on the source code.

Its not compiling or translating the code into something new which could be saved because its a kind of executing the code.

The Opcache by Zend is able to store precompiled bytecode and to use it again. (I know how it generally works.)

http://www.sitepoint.com/understanding-opcache/

My question:

Where does the Opcache gets his precompiled scripts from when the interpreter is not compiling?


Its not compiling or translating the code into something new which could be saved because its a kind of executing the code.

That's incorrect. The first thing the interpreter does is compile the PHP source code into an executable bytecode format, which is then executed.

It's not unlike what .NET and Java do, except that they do it pre-emptively ahead of time, whereas PHP does it on-demand as the script is executed.

Things like the OPcache take this bytecode and cache that, saving the interpreter from having to fetch the source code and parse it each time a script is executed.

链接地址: http://www.djcxy.com/p/52566.html

上一篇: 使用<keygen>获得RSA密钥以用于JavaScript?

下一篇: PHP解释器Opcache