PHP version guides

Trace the language from PHP 5.3 through current PHP 8.x releases, with practical examples and migration checklists.

  • PHP 8.5 — Pipes & platform tightening

    Pipe operator `|>`, `#[\NoDiscard]`, closures in constant expressions, ext/uri, stricter filter/PDO/Opcache behavior.

  • PHP 8.4 — Property hooks & lazy objects

    Property hooks, asymmetric visibility, lazy objects, new `Dom\*` API, `#[Deprecated]`, and deprecations to clear before the next jump.

  • PHP 8.3 — Precision & JSON

    `#[Override]`, typed class constants, `json_validate`, `str_increment` / `str_decrement`, and runtime fixes that show up under load.

  • PHP 8.2 — Types & dynamic properties

    Readonly classes, DNF types, standalone `null`/`false`/`true`, `#[SensitiveParameter]`, Random extension, dynamic property deprecations.

  • PHP 8.1 — Enums & readonly

    Enums, readonly properties, fibers, intersection types, first-class callables, and migration tightening vs 8.0.

  • PHP 8.0 — Major language reboot

    Named arguments, match, attributes, JIT, union types, nullsafe `?->`, and stricter behavior across the standard library.

  • PHP 7.4 — The last 7.x feature release

    Typed properties, arrow functions, FFI, OPcache preloading, `__serialize` / `__unserialize`, and BC traps (typed props, password constants, extensions).

  • PHP 7.3 — Syntax polish before 7.4

    Flexible heredoc/nowdoc, trailing commas in calls, `JsonException`, `is_countable`, `array_key_first`/`last`, PCRE2, Argon2id—and subtle BC (ArrayAccess keys, references, `continue` in `switch`).

  • PHP 7.2 — object type & libsodium

    `object` hint, parameter type widening, Sodium in core, LDAP EXOP, addrinfo sockets—`count()`/`get_class(null)` warnings and mcrypt moved to PECL.

  • PHP 7.1 — Nullable, void, iterable

    `?Type`, `void`, `iterable`, constant visibility, multi-catch, keyed `list()`—plus `ArgumentCountError`, session INI removals, and string offset BC.

  • PHP 7.0 — The PHP 5 break

    Scalar & return types, `??` and `<=>`, anonymous classes, `Closure::call`, generators, `random_bytes`, filtered `unserialize`—and `Throwable`/BC from the 5.x era.

  • PHP 5.6 — Variadic & `**`

    Variadic `...`, argument unpacking, `**` exponentiation, `use function`/`const`, constant expressions—last stop before PHP 7’s engine leap.

  • PHP 5.5 — Generators & `password_*`

    `yield` generators, `finally`, `password_hash` API, `array_column`, `ClassName::class`—and subtle `foreach`/`list()` BC worth regression-testing.

  • PHP 5.4 — Traits & `[]`

    Traits, short array syntax `[]`, callable type hint, `$this` in closures, built-in web server—magic quotes & `register_globals` removed, `mysql` deprecated.

  • PHP 5.3 — Namespaces & closures

    Namespaces, `use`, late static binding, closures, `goto`, NOWDOC, optional cycle GC, Phar—plus BC (new keywords, `ereg*` deprecated) on the road away from PHP 4 habits.