PHP is a general-purpose server side scripting language. It is well known that the php code are interpreted when the page loads and resulting webpage is shown. Recently I have heard of Just in time compilers for PHP(HipHop Virtual Machine). would like to know what kind of difference would it make in the execution and is it better to have a jit instead of interpreter? are the any php engines that have jit ?
EDIT: Is PHP Execution flow like this ?: php code -> parsing -> tokens -> bytecode/opcode -> php engine interpretation -> machine code -> execution
Corect me if I am wrong. Bytecodes are generally executed in virtual machines. An Opcode( is close to machine language) can be executed by machine directly. Does this mean a php engine is a virtual machine or just some implementations of it are virtual machines?
Thanks in Advance.
HipHop is not a JIT compiler - it's a code converter which changes PHP into C++ which can then be compiled using a conventional offline compiler.
As a result, eval and create_function won't work, nor the tokenizer functions. I've not looked into the matter deeply, but I would expect that conditional / runtime evaluated include operations will likely cause problems too.
There wouldn't be much point unless it made the code much faster.
OTOH using a PHP opcode cache gives a huge performance boost (not quite as much as native code) without compromising functionality.
(given the architecture off PHP a JIT compiler doesn't really make a lot of sense)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With