Overview

Version 1.0 of the Zend Engine functions much like the heart and brain of PHP 4.0. It contains the process that provides the sub-structure and facilities to the functional modules. It also implements the language syntax, as well. The Zend Engine 1.0 is actually the second revision of the PHP scripting engine. It is still based on the same rules as the PHP 3.0 engine that was basically Zend Engine 0.5. Now it is permissible to migrate the path from PHP 3.0 to 4.0. The development has the same ‘state of mind’ as per PHP 3.0. We feel it is right time to start working towards a revision of the Zend Engine. It would also incorporate new structures and solutions to some of the most difficult problems faced by the PHP designer or developers.

 

In this article I will discuss the Zend Engine internals based on the PHP platform.

 

Introduction

Zend Engine is an open source scripting engine which acts as an interpreter for the PHP programming language. This was initially developed by two students at the Technion - Israel Institute of Technology. Zend engine is a virtual machine or VM. As we know that a Virtual machine is nothing but software which simulates a physical computer. The Zend engine consists of multiple components e.g. a compiler, ZFMI (Zend Function Module Interface) and a virtual CPU or an executor.

 

How Zend Engine Works

A Zend engine consists of three major components:

   → Lexical analyzer or lexer

   → Parser

   → Executor

 

We know that Zend is a scripting engine and it works as an interpreter. So let us check different phases of a script which is subjected to a Zend engine. The script passes through the following steps and finally gets executed by Zend engine: