Does PHP have a virtual machine like Java?

后端 未结 3 1338
盖世英雄少女心
盖世英雄少女心 2021-01-04 07:35

Does PHP have a virtual machine like Java?

3条回答
  •  北海茫月
    2021-01-04 08:04

    Another important difference between the Zend Engine and a typical JVM is in the way they execute bytecodes:

    • The Zend Engine executes (interprets) the compiled bytecodes directly. (At least that's what I think happens. I wasn't able to confirm this from the Zend online documentation!)
    • A JVM will normally use a JIT compiler to compile bytecodes to native instructions, and then execute the native instructions.

    Actually, JVM behaviour is more complicated than this. JVMs don't always compile to native code, and when they do, they typically delay JIT compilation until they figure it is worth doing. Prior to that, they execute the bytecodes directly.

提交回复
热议问题