PHP Tutorial · PHP Basics · Lesson 13 of 38
PHP History & Versions
How PHP grew from Rasmus Lerdorf's personal home page tools into the language behind a large share of the web, every major release on one timeline, the big leaps in PHP 7 and 8, and which version to run today.
How PHP started
In 1994, Rasmus Lerdorf wrote a few small programs in C to track visits to his online résumé. He called them Personal Home Page Tools and released them publicly in June 1995 so others could use and improve them. The next version, PHP/FI (Personal Home Page / Forms Interpreter), could also process HTML forms and talk to databases, and it spread quickly among people building dynamic websites.
In 1997, Andi Gutmans and Zeev Suraski rewrote the parser for an e-commerce project. Together with Lerdorf they released it as PHP 3 in June 1998, renamed to the recursive acronym "PHP: Hypertext Preprocessor". They then rewrote the core again as the Zend Engine, which has powered every PHP version since PHP 4. PHP is developed in the open by its contributors; new features are proposed as RFCs and accepted by a vote of core developers. The PHP Foundation, founded in 2021, funds core development.
PHP's mix of easy deployment, an HTML-friendly syntax and a huge built-in function library made it the language of WordPress, Wikipedia (MediaWiki), Drupal, Magento and Laravel.
Timeline of major versions
- PHP 8.5Current
- The pipe operator
|>for left-to-right chains of calls clone($object, [...])to change properties while cloning, and the#[\NoDiscard]attribute- A built-in URI extension (RFC 3986 and WHATWG URLs),
array_first()andarray_last()
- The pipe operator
- PHP 8.4Supported
- Property hooks (
get/seton properties) and asymmetric visibilitypublic private(set) new Foo()->bar()without extra parentheses,array_find(),array_any(),array_all(), lazy objects
- Property hooks (
- PHP 8.3Security fixes until Dec 2027
- Typed class constants, the
#[\Override]attribute,json_validate()
- Typed class constants, the
- PHP 8.2Security fixes until Dec 2026
readonlyclasses, DNF types such as(A&B)|null; dynamic properties deprecated
- PHP 8.1End of life · Dec 2025
- Enums,
readonlyproperties, Fibers, theneverreturn type, first-class callablesstrlen(...)
- Enums,
- PHP 8.0End of life · Nov 2023
- The JIT compiler, named arguments, union types,
match, the nullsafe operator?->, attributes, constructor property promotion
- The JIT compiler, named arguments, union types,
- PHP 7.4End of life · Nov 2022
- Typed properties, arrow functions
fn($x) => $x * 2, preloading
- Typed properties, arrow functions
- PHP 7.0End of life · Jan 2019
- The new engine (PHPNG) made PHP up to twice as fast with much less memory
- Scalar parameter and return types,
??, the spaceship operator<=>; engine errors becomeErrorexceptions
- PHP 5.6End of life · Dec 2018
- The last PHP 5 release; PHP 6 (a Unicode rewrite) was abandoned, so the next version was 7
- PHP 5.4Historic
- Traits, short array syntax
[1, 2, 3], a built-in development web server
- Traits, short array syntax
- PHP 5.3Historic
- Namespaces, closures (anonymous functions) and late static binding
- PHP 5.0Historic
- Zend Engine 2 with a real object model: visibility, interfaces, exceptions
- PHP 4.0Historic
- Zend Engine 1, sessions and output buffering
- PHP 3.0Historic
- The rewrite by Gutmans and Suraski; extensions; renamed "PHP: Hypertext Preprocessor"
- PHP/FI 2.0Historic
- Form handling and database support
- PHP Tools 1.0Historic
- Rasmus Lerdorf releases the Personal Home Page Tools
How PHP modernized
- Performance. PHP 7's new engine roughly doubled speed and halved memory use, and PHP 8 added a JIT compiler for CPU-heavy code.
- A real type system. Scalar types (7.0), typed properties (7.4), union types (8.0), enums and
readonly(8.1) and typed constants (8.3) let PHP catch many bugs early, and static analysers such as PHPStan and Psalm build on them. - Safer defaults. Engine errors became catchable exceptions (7.0), many silent warnings became errors (8.0), and error-prone features such as dynamic properties were deprecated.
- A predictable lifecycle. A new version ships every November. Each version gets 2 years of active support and then 2 years of security fixes.
- A modern ecosystem. Composer (2012) and the PHP-FIG standards (PSR) made sharing packages easy, and frameworks such as Laravel and Symfony are built on them.
PHP 5 vs PHP 7 vs PHP 8
| Topic | PHP 5.6 | PHP 7.4 | PHP 8.x |
|---|---|---|---|
| Speed | Baseline | About 2× faster | Faster still, plus an optional JIT |
| Types | Class/array type hints only | Scalar, return, nullable and property types | Union, mixed, never, DNF types, enums, typed constants |
| Errors | Fatal errors stop the script | Engine errors throw Error |
More warnings promoted to TypeError / ValueError |
| Arguments | Positional only | Positional only | Named arguments: str_pad(string: $s, length: 10) |
| Branching | switch |
switch |
match expression |
| Null checks | isset() everywhere |
?? and ??= |
Also ?-> |
| Removed | — | mysql_*, ereg* (removed in 7.0) |
each(), create_function() (removed in 8.0) |
Which version should you use?
- New projects: PHP 8.4 or 8.5. Both receive active support with bug fixes.
- Existing projects: at least a version that still gets security fixes (8.2 or newer today; 8.2 reaches end of life on 31 December 2026). Running an end-of-life PHP version on a public server is a security risk.
- This tutorial: examples run in your browser on PHP 8.3 (WebAssembly). Anything that needs 8.4 or 8.5 says so.
Official resources
- php.net and the PHP manual
- Supported versions: active support and security-fix dates
- PHP RFCs: every proposal and vote behind the language's features
- Release announcements and the history of PHP in the manual
- The PHP Foundation
- PHP release schedule on endoflife.date
Last reviewed 21 October 2026. Release and support dates come from the official release pages linked above.