A .php file records no version, so the same text can mean different things
on different releases. Each release is described below. The dates come from the
PHP ChangeLog and the manual’s
History of PHP, and the
features from its migration guides.
The manual’s supported versions
page lists the branches that still receive fixes.
Timeline
| Version | Released | Headline |
|---|---|---|
| PHP Tools | June 1995 | Source released to the public |
| PHP/FI 2.0 | November 1997 (out of beta) | Forms Interpreter, embedded in HTML |
| 3.0 | June 1998 | Rewritten parser, extensions, classes |
| 4.0 | 22 May 2000 | Zend Engine, sessions, output buffering |
| 4.1 | 10 Dec 2001 | Superglobals |
| 4.2 | 22 Apr 2002 | register_globals off by default |
| 4.3 | 27 Dec 2002 | CLI SAPI |
| 4.4 | 11 Jul 2005 | Final PHP 4 branch |
| 5.0 | 13 Jul 2004 | New object model, Zend Engine 2 |
| 5.1 | 24 Nov 2005 | PDO enabled by default |
| 5.2 | 2 Nov 2006 | JSON, filter and date extensions |
| 5.3 | 30 Jun 2009 | Namespaces, closures, late static binding |
| 5.4 | 1 Mar 2012 | Traits, short array syntax |
| 5.5 | 20 Jun 2013 | Generators, finally |
| 5.6 | 28 Aug 2014 | Variadics, constant expressions |
| 7.0 | 3 Dec 2015 | Zend Engine 3, scalar types |
| 7.1 | 1 Dec 2016 | Nullable types, void |
| 7.2 | 30 Nov 2017 | object type |
| 7.3 | 6 Dec 2018 | Flexible heredoc |
| 7.4 | 28 Nov 2019 | Typed properties, arrow functions |
| 8.0 | 26 Nov 2020 | JIT, union types, attributes, match |
| 8.1 | 25 Nov 2021 | Enums, fibers, readonly properties |
| 8.2 | 8 Dec 2022 | Readonly classes, DNF types |
| 8.3 | 23 Nov 2023 | Typed class constants, #[\Override] |
| 8.4 | 21 Nov 2024 (as 8.4.1) | Property hooks, asymmetric visibility |
| 8.5 | 20 Nov 2025 | Pipe operator, clone with, URI extension |
PHP/FI and PHP 3
In 1994 Rasmus Lerdorf wrote a set of CGI programs in C to track visits to his online CV, and called them Personal Home Page Tools. The source was released in June 1995. A rewrite in 1995 combined the tools with a form interpreter, and the result was named PHP/FI in April 1996, with database support, cookies and user-defined functions. PHP/FI 2.0 came out of beta in November 1997.
Andi Gutmans and Zeev Suraski rewrote the parser from 1997. Together with Lerdorf they
renamed the language PHP, now standing for “PHP: Hypertext Preprocessor”, and
released PHP 3.0 in June 1998. It added a much stronger extension interface,
object-oriented programming with classes and a more consistent syntax. Files were
often named .php3.
PHP 4
Released on 22 May 2000, built on the Zend Engine, a rewrite of the core. It added
support for more web servers, HTTP sessions, output buffering and safer handling of user
input. foreach also dates from this version. Objects were still
copied by value, as in PHP 3.
- 4.1 added the superglobals,
$_GET,$_POSTand the like. - 4.2 switched
register_globalsoff by default, so that request data no longer appeared automatically as variables. - 4.3 introduced the CLI SAPI.
PHP 5
Released on 13 July 2004, on Zend Engine 2.
5.0
A new object model. Objects are held by handle instead of copied. Added
public, protected, private,
abstract, final, interface, class constants,
static, clone, __construct() and
__destruct(), magic methods, exceptions with
try and catch, and class type declarations on parameters.
5.1
array as a parameter type. PDO enabled by default.
5.2
The JSON, filter and date extensions (DateTime).
5.3
Namespaces, late static binding (static::), closures, nowdoc,
goto, the ?: operator, __DIR__,
__callStatic(), const outside classes, and Phar bundled.
5.4
Traits, short array syntax ([1, 2]), <?= always on,
array dereferencing of function results, $this in closures, binary integer
literals, the callable type and the built-in web server. Removed
register_globals, safe_mode, magic quotes and
break $var.
5.5
Generators, finally, list() in foreach,
Foo::class, empty() on any expression, the password hashing
API and OPcache bundled.
5.6
Variadic parameters and argument unpacking with ...,
**, constant expressions, const arrays, use
function and use const, __debugInfo(), phpdbg,
and default_charset defaulting to UTF-8.
PHP 6
There was never a PHP 6. Work on it aimed to bring deep Unicode support into the engine and language. That work was abandoned. Its other features reached PHP 5.3 and 5.4 (namespaces, traits, short array syntax), and the next major release was PHP 7.
PHP 7
Released on 3 December 2015, on Zend Engine 3, with large performance gains and consistent 64-bit support.
7.0
Added scalar type declarations and
strict_types, return
types, ??, <=>, constant arrays with
define(), anonymous classes, \u{…} escapes,
Closure::call(), group use, generator return values and
yield from, intdiv(), and the Throwable hierarchy
with engine errors as Error.
Changed: uniform variable syntax, which reads indirect expressions strictly from
left to right; list() assigns in order; foreach no longer
moves the internal pointer.
Removed: ASP tags and <script language="php">, the
ereg and mysql extensions, and others. Old-style constructors
were deprecated.
7.1
Nullable types, void, iterable, multi-catch, symmetric
[$a, $b] destructuring with keys, class constant visibility, negative
string offsets and Closure::fromCallable().
7.2
The object type, parameter type widening on overrides, overriding
abstract methods with abstract methods, a trailing comma in group
use, and the Sodium extension in core. mcrypt moved to
PECL.
7.3
Flexible heredoc and nowdoc,
references in destructuring, CompileError, and trailing commas in
calls.
7.4
Typed properties, arrow
functions, ??=, spread in array literals, numeric literal separators,
return type covariance and parameter contravariance, WeakReference,
__serialize(), exceptions from __toString(), preloading and
the FFI extension. Deprecated nested ternaries without parentheses and
$a{0} offsets.
PHP 8
8.0
Added the JIT compiler, union types, match, named arguments,
attributes, the nullsafe operator,
constructor promotion, mixed and static return types,
throw as an expression, WeakMap, Stringable,
$obj::class, a trailing comma in parameter lists, and catches without a
variable.
Changed: number and string comparison, . precedence, many warnings
became Error or TypeError, undefined variables and keys
became warnings, and error_reporting defaulted to E_ALL.
@ no longer hides fatal errors. #[ no longer starts a
comment.
Removed: (real) and (unset) casts, $a{0},
__autoload(), create_function(), each(),
old-style constructors, calling non-static methods statically and
track_errors.
8.1
Enums, fibers, readonly properties, intersection
types, never, first-class callable syntax, new in initialisers,
final class constants, 0o octal literals, and array unpacking
with string keys. Restricted whole-array writes to $GLOBALS. Deprecated
passing null to built-in scalar parameters, implicit lossy float-to-int
conversion, and autovivification from false.
8.2
Readonly classes, DNF types, standalone null, false and
true types, constants in traits, enum properties in constant expressions,
#[\SensitiveParameter], and the Random extension. Deprecated dynamic
properties, "${var}" interpolation and relative callables such as
"self::method".
8.3
Typed class constants, dynamic class constant fetch (C::{$name}),
#[\Override], arbitrary static variable initialisers, readonly
reinitialisation in __clone(), final on trait methods with
as, and json_validate().
8.4
Property hooks,
asymmetric visibility,
lazy objects, #[\Deprecated], new Foo()->bar() without
parentheses, and interface and abstract properties. New functions include
array_find(), array_find_key(), array_any(),
array_all(), mb_trim() and fpow().
exit() and die() behave like functions.
Deprecated: implicitly nullable parameters, _ as a class name,
raising zero to a negative power, E_USER_ERROR with
trigger_error(), and the E_STRICT constant.
8.5
Released on 20 November 2025. Pipe
operator, clone with new
property values, #[\NoDiscard] and the (void) cast,
static closures and first-class callables in constant expressions, attributes on
constants, #[\Override] on properties, #[\DelayedTargetValidation],
final promoted properties, asymmetric visibility on static properties, casts in
constant expressions, the URI extension, array_first() and
array_last(), Closure::getCurrent(), and backtraces for
fatal errors.
Deprecated: the backtick operator, the casts (integer),
(boolean), (double) and (binary), a semicolon
after case, null as an array offset, and
__sleep() and __wakeup() (soft). Removed:
disable_classes. Traits now bind before the parent class.
8.6
At the time of writing PHP 8.6 is at the release candidate stage and has not been
released. The manual’s
migration
guide lists defaults for readonly properties, reference assignment in a
WeakMap, __debugInfo() in enums, #[\Override]
on class constants, partial function application (add(1, ?)), writing
to properties of objects held in constants, and endianness modifiers for
pack(). The form feed joins the default characters removed by
trim().