Is PHP compiled or interpreted?


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

PHP compiler is responsible for

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

PHP Interpreter does

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

Updated on: 29-Jun-2020

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements