responsive.sk

Article

PHP history ... from one person's tool to the Zend Engine 4

Article cover illustration: Architecture, php, history, zend

In the first part of the series we saw that PHP is the Zend engine ... a compiler and virtual machine written in C. Now let's look at how PHP got there. The history of PHP is the story of one repeating pattern:
every time PHP needed to be faster, the engine was rewritten in C. No extra layer, no middleware ... new C code.

PHP didn't get faster by adding abstractions. It got faster by rewriting the engine.

The problem with most languages: performance degrades as layers accumulate.

Timeline

YearVersionEngineWhat it brought
1994PHP/FI...Rasmus Lerdorf writes a tool for his personal homepage (Personal Home Page Tools)
1995PHP/FI 2...First version named PHP ... form processing, database queries
1997PHP 3Zend Engine 1Zeev Suraski and Andi Gutmans rewrite the parser ... birth of the Zend engine (Zend = Zeev + Andi), named PHP: Hypertext Preprocessor
2000PHP 4Zend Engine 1More mature runtime, session support, significantly faster
2004PHP 5Zend Engine 2New object model, exceptions, PDO, MySQLi
2015PHP 7Zend Engine 3 (PHPNG)Twice the speed, half the memory ... the PHPNG project
2020PHP 8.0Zend Engine 4JIT, union types, match, named arguments
2025PHP 8.5Zend Engine 4Current version ... our stack runs on it too

From a "tool for a personal page" to Zend

Rasmus Lerdorf didn't originally plan PHP as a language. He just wanted simple tools for his personal homepage: a visit counter, a form, a few database queries. That's how PHP/FI was born ... a collection of C scripts that later became an interpreter.

The turning point came in 1997, when two students ... Zeev Suraski and Andi Gutmans ... needed PHP for a university project and ran into the limits of the original parser. Instead of complaining, they rewrote it. The result: PHP 3 and a brand new engine they named Zend. The rest, as they say, is history ... today the Zend engine powers more than three quarters of the web.

Every jump = new C code

Notice the pattern in the table:

  • PHP 5 (Zend Engine 2) ... a new object model in C, because the old one

couldn't carry the objects the language needed.

  • PHP 7 (Zend Engine 3) ... the PHPNG (PHP Next Generation) project

rewrote the data structures and the execution loop. Result: twice the speed and half the memory. No syntax change, no new layer ... new C code under the hood.

  • PHP 8.0 (Zend Engine 4) ... JIT arrived, compiling hot paths all the

way down to native machine code. Again: C.

PHP never got faster by adding abstraction. It always got faster by moving more work into C. That's exactly the pattern we talk about throughout this series: "Why PHP is fast" confirms it at every step.

What you won't find in the history

For completeness: PHP 6 never shipped. It was supposed to bring native Unicode support, but the project was never finished and the number 6 was skipped. PHP 7 came instead, with PHPNG ... which is itself a metaphor for the whole history: when a big idea fails, PHP doesn't slow down, it rewrites the engine.

Summary

  • PHP started as PHP/FI (1994) ... Rasmus Lerdorf's tool for his

personal page

  • The Zend engine was born in 1997 when Zeev Suraski and Andi Gutmans

rewrote the parser (Zend = Zeev + Andi)

  • Every engine generation (ZE1 → ZE2 → ZE3 → ZE4) was new C code

under the hood

  • The biggest jump: PHP 7 / PHPNG ... twice the speed, half the memory,

no syntax change

  • PHP 8 added JIT ... compilation to native machine code
  • The pattern of history: PHP doesn't speed up by adding layers, but by

moving work into C ... exactly the philosophy our stack is built on

The Zend engine remains the foundation of PHP. Four generations, same philosophy: speed comes from C, not from frameworks.


Every big speed jump in PHP meant a new engine written in C. That pattern hasn't changed.


A language's history is its architecture decisions.


→ PHP C extensions API: how extensions work at the C level → OPcache and JIT: precompilation and native machine code

Sources

Comments (0)

No comments yet — be the first to react.

Reader questions (0)

No questions yet — be the first to ask.

Stuck on something in this article? Ask below. Your name is shown publicly; your email is never stored. A question appears here once a moderator approves it.