History of PHP

From a personal homepage CGI hack to the language powering 77% of the web. 30 years of evolution.

A Personal Home Page

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.

The Evolution of PHP
1994 – 1995
PHP/FI (Personal Home Page / Forms Interpreter)
Rasmus Lerdorf writes CGI scripts in C to track his resume views. Releases them as open source. Adds a forms interpreter and basic database access. The web is young, and PHP fills a void.
1997 – 1998
PHP 3
Zeev Suraski and Andi Gutmans, two Israeli students at the Technion, completely rewrite the PHP parser. PHP 3 is the first version that resembles modern PHP. It gets a new recursive acronym: "PHP: Hypertext Preprocessor." Adoption explodes — PHP 3 is installed on ~10% of web servers within a year.
2000
PHP 4 (Zend Engine 1.0)
Suraski and Gutmans create the Zend Engine, a complete rewrite of PHP's core. PHP 4 introduces sessions, output buffering, and improved performance. They found Zend Technologies to commercially support PHP. PHP becomes the dominant web language.
2004
PHP 5 (Zend Engine 2.0)
A massive upgrade: real object-oriented programming with visibility modifiers, abstract classes, interfaces, exceptions, foreach improvements, SimpleXML, PDO for database access, and the SPL. PHP 5 made PHP a "real" programming language.
2005 – 2014
The PHP 6 That Never Was
An ambitious plan to add native Unicode support to PHP's core. After years of development, the effort was abandoned — the performance cost was too high and the implementation too complex. The PHP 6 version number was skipped entirely to avoid confusion with the abandoned branch. Features that worked were backported to PHP 5.3 and 5.4.
2015
PHP 7
The biggest PHP release ever. The new Zend Engine 3.0 (based on phpng) delivered 2x performance improvement over PHP 5.6. Added scalar type declarations, return type declarations, null coalescing operator (??), spaceship operator (<=>), anonymous classes, and removed legacy cruft. PHP 7 silenced the "PHP is slow" critics overnight.
2020
PHP 8.0
JIT compilation via OPcache's tracing JIT. Union types, named arguments, match expressions, nullsafe operator (?->), constructor property promotion, and attributes (#[...]). PHP 8 marked the language's entry into the modern era.
2021
PHP 8.1
Enums, fibers (cooperative multitasking), readonly properties, intersection types, never return type, first-class callable syntax. Fibers opened the door to async PHP without callbacks.
2022
PHP 8.2
Readonly classes, disjunctive normal form (DNF) types, standalone types (true, false, null), random extension overhaul, deprecated dynamic properties.
2023
PHP 8.3
Typed class constants, json_validate(), #[\Override] attribute, deep cloning of readonly properties, improved randomizer. Continued refinement of PHP's type system.
All Major PHP Versions
VersionYearEngineKey Additions
PHP/FI1995Custom C CGIOriginal forms interpreter, basic DB access
PHP 31998Rewritten parserExtensibility, new parser by Suraski & Gutmans
PHP 42000Zend Engine 1.0Sessions, output buffering, references, better perf
PHP 52004Zend Engine 2.0OOP (classes, interfaces, exceptions), PDO, SPL
PHP 6AbandonedNative Unicode (cancelled — version skipped)
PHP 72015Zend Engine 3.02x speed, type declarations, ?? operator, anonymous classes
PHP 8.02020Zend + JITJIT compiler, union types, named args, match, attributes
PHP 8.12021Zend + JITEnums, fibers, readonly properties, intersection types
PHP 8.22022Zend + JITReadonly classes, DNF types, standalone types
PHP 8.32023Zend + JITTyped class constants, json_validate, #[\Override]
The Accidental Language

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.

"I was not trying to write a programming language. I don't know how to write a programming language. I just kept adding the next logical step on the way."
— Rasmus Lerdorf, creator of PHP