Latest in branch 8.4
8.4.21
Released 07 May 2026
(1 month ago)
SoftwarePHP
Version8.4
Status
Supported
Initial release8.4.1
21 Nov 2024
(1 year ago)
Latest release8.4.21
07 May 2026
(1 month ago)
End of bug fixes31 Dec 2026
(Ends in 6 months)
End of security fixes31 Dec 2028
(Ends in 2 years, 6 months)
Release noteshttps://www.php.net/ChangeLog-8.php#8.4.21
Source codehttps://github.com/php/php-src/tree/php-8.4.21
Documentationhttps://www.php.net/manual/en/
Downloadhttps://www.php.net/releases/8.4.21
PHP 8.4 ReleasesView full list

What is New in PHP 8.4

PHP 8.4 brings exciting updates to enhance developer productivity and performance. It introduces powerful features like property hooks, new DOM improvements, and array functions, alongside performance tweaks and bug fixes. This version also includes new tools for better code safety and flexibility, making it a valuable upgrade for web projects.

Property Hooks

Property hooks allow developers to define custom logic when getting or setting property values. This reduces boilerplate code by replacing traditional getters and setters with inline hooks.

class User {
    private string $name;

    public string $displayName {
        get => strtoupper($this->name);
        set => $this->name = strtolower($value);
    }
}

These hooks support both simple and complex operations, improving object-oriented design.

New DOM Enhancements

The DOM extension now supports HTML5 with a new Dom\HTMLDocument class, built on the Lexbor library. This offers better parsing and compliance with modern standards, while keeping the old DOMDocument for compatibility.

$doc = Dom\HTMLDocument::createFromString('<!DOCTYPE html><html><body>Hello</body></html>');
echo $doc->documentElement->tagName; // Outputs: html

This update fixes long-standing issues and adds convenient methods for handling HTML documents.

Array Functions

New array utilities simplify common tasks. Functions like array_find, array_find_key, array_any, and array_all help search and evaluate array elements efficiently.

$numbers = [1, 2, 3, 4];
$result = array_find($numbers, fn($value) => $value > 2);
echo $result; // Outputs: 3

These tools make array handling more intuitive and powerful.

Class Instantiation Improvements

You can now chain methods or access properties directly after creating an object without extra parentheses, reducing syntax clutter.

$class = new ReflectionClass(User::class)->getName();
echo $class; // Outputs: User

This change enhances readability, especially in complex method chains.

Asymmetric Visibility

Properties can now have different visibility for reading and writing, offering more control over access levels.

class Example {
    public read private write string $data;
}

This feature supports advanced encapsulation strategies.

Additional Features

  • mb_trim, mb_ltrim, and mb_rtrim for multi-byte string trimming.
  • bcdivmod in BCMath for division and modulus in one call.
  • CURL_HTTP_VERSION_3 and CURL_HTTP_VERSION_3ONLY for HTTP/3 support.
  • #[\Deprecated] attribute to mark outdated code.
  • New DateTime methods like createFromTimestamp for easier time handling.

Deprecations and Changes

Some features are marked for removal in future versions:

Deprecated Feature Details
Implicit nullable types Requires explicit ?type syntax, e.g., ?string $value = null.
GET/POST session tracking Disabled by default; use cookies instead.

Performance and Bug Fixes

PHP 8.4 includes optimizations in the JIT compiler and fixes for memory leaks and security issues. These improvements ensure better stability and speed for web applications.

Why Upgrade to PHP 8.4

With its new tools and enhancements, PHP 8.4 offers a modern approach to web development. It provides better performance, cleaner code, and robust features, making it a smart choice for developers building secure and efficient websites.

Releases In Branch 8.4

VersionRelease date
8.4.2107 May 2026
(1 month ago)
8.4.2009 Apr 2026
(2 months ago)
8.4.1912 Mar 2026
(2 months ago)
8.4.1812 Feb 2026
(3 months ago)
8.4.1715 Jan 2026
(4 months ago)
8.4.1618 Dec 2025
(5 months ago)
8.4.1520 Nov 2025
(6 months ago)
8.4.1423 Oct 2025
(7 months ago)
8.4.1325 Sep 2025
(8 months ago)
8.4.1228 Aug 2025
(9 months ago)
8.4.1131 Jul 2025
(10 months ago)
8.4.1003 Jul 2025
(11 months ago)
8.4.805 Jun 2025
(1 year ago)
8.4.708 May 2025
(1 year ago)
8.4.610 Apr 2025
(1 year ago)
8.4.513 Mar 2025
(1 year ago)
8.4.413 Feb 2025
(1 year ago)
8.4.316 Jan 2025
(1 year ago)
8.4.219 Dec 2024
(1 year ago)
8.4.121 Nov 2024
(1 year ago)