3 ms·
Igorw's post uses the word compiler four times.
by alayne 12y ago
Igorw's post uses the word compiler four times.
- Someone1234 12y agoPHP compiles but acts as an interpreter. The Wikipedia article covers this[0]: > The Zend Engine compiles PHP source code on-the-fly into an internal format that it can execute, thus it works as an interpreter. I won't get drawn into a highly dull debate on the definition of what an interpreter is or isn't. Instead let's just agree that PHP by default generates the OPCodes every single time a request comes in. That's all we need to understand for this context (that OPCode generation is in-line with requests, not pre-compiled or otherwise cached). Also, yes, there are tons and tons of implementations of PHP caching/precompilation/JIT/etc. [0] https://en.wikipedia.org/wiki/PHP#Implementations https://en.wikipedia.org/wiki/PHP#Implementations
- deleted 12y ago[deleted]
- kyberias 12y agoThe original author wanted to generate byte code that executes as efficiently as possible. Clearly scoped goal. :) Because PHP's compiler component, which he refers to as "compiler", did not generate efficient byte code for the interpreter, he had to use GOTO to force the compiler to generate it. Whether the byte codes get cached or not might be irrelevant to his goals. We cannot be certain what proportion of time is wasted in network, compilation or serving the request. It could be one way or another. USUALLY this is a waste of time. The developer's time that is.