Both, PHP is compiled down to an intermediate bytecode that is then interpreted by the runtime engine.

PHP compiler is responsible for:

  • convert code to a bytecode that can be used by runtime engine.
  • resolve functions, names and classes names
  • creating symbol table

then, PHP Interpretor does:

  • Goes through the bytecode line by line and executes it
  • Handles runtime exception