From a personal homepage CGI hack to the language powering 77% of the web. 30 years of evolution.
In 1994, Rasmus Lerdorf, a Danish-Canadian programmer, wrote a set of C-language CGI binaries to track visits to his online resume. He called them "Personal Home Page Tools" — PHP Tools. The original scripts were simple: they parsed form data, connected to databases, and generated HTML.
Lerdorf released the source code publicly in 1995, and other developers began contributing. What started as a personal toolkit rapidly grew into a templating language. Lerdorf added a forms interpreter (PHP/FI — "Personal Home Page / Forms Interpreter") that could be embedded directly in HTML.
The key insight was deceptively simple: put code inside HTML, not HTML inside code. Instead of writing a program that outputs HTML (like CGI scripts in C or Perl), you wrote HTML with <?php ?> tags containing logic. This inverted model made dynamic web pages accessible to anyone who knew HTML.
foreach improvements, SimpleXML, PDO for database access, and the SPL. PHP 5 made PHP a "real" programming language.??), spaceship operator (<=>), anonymous classes, and removed legacy cruft. PHP 7 silenced the "PHP is slow" critics overnight.?->), constructor property promotion, and attributes (#[...]). PHP 8 marked the language's entry into the modern era.never return type, first-class callable syntax. Fibers opened the door to async PHP without callbacks.true, false, null), random extension overhaul, deprecated dynamic properties.json_validate(), #[\Override] attribute, deep cloning of readonly properties, improved randomizer. Continued refinement of PHP's type system.| Version | Year | Engine | Key Additions |
|---|---|---|---|
| PHP/FI | 1995 | Custom C CGI | Original forms interpreter, basic DB access |
| PHP 3 | 1998 | Rewritten parser | Extensibility, new parser by Suraski & Gutmans |
| PHP 4 | 2000 | Zend Engine 1.0 | Sessions, output buffering, references, better perf |
| PHP 5 | 2004 | Zend Engine 2.0 | OOP (classes, interfaces, exceptions), PDO, SPL |
| PHP 6 | — | Abandoned | Native Unicode (cancelled — version skipped) |
| PHP 7 | 2015 | Zend Engine 3.0 | 2x speed, type declarations, ?? operator, anonymous classes |
| PHP 8.0 | 2020 | Zend + JIT | JIT compiler, union types, named args, match, attributes |
| PHP 8.1 | 2021 | Zend + JIT | Enums, fibers, readonly properties, intersection types |
| PHP 8.2 | 2022 | Zend + JIT | Readonly classes, DNF types, standalone types |
| PHP 8.3 | 2023 | Zend + JIT | Typed class constants, json_validate, #[\Override] |
PHP was never designed to be a programming language. Rasmus Lerdorf has said this explicitly: "I don't know how to stop it, there was never any intent to write a programming language." PHP grew organically, driven by what web developers needed, not by language design theory.
This organic growth is both PHP's greatest strength and its most criticized weakness. The standard library has inconsistent naming conventions (str_replace vs strpos), inconsistent parameter ordering, and historical quirks. But it also means PHP evolved to solve real problems, not theoretical ones. Every function in PHP's standard library exists because someone needed it on a real website.