PHP continues to evolve rapidly. As of 2025, the latest stable release is PHP 8.4 (released Nov 21, 2024), with PHP 8.5 slated for November 2025.
Nov 21, 2024: PHP 8.4 released
November 2025: PHP 8.5 slated for release
Each annual PHP release adds new language features and optimizations, while also deprecating outdated behaviors.
For example, the official 8.4 release notes warn that “with this release including several exciting new features and a few key deprecations… teams will need to assess how the changes in PHP 8.4 impact their applications”.
In practice, PHP 8.x series (8.0 through 8.4) has introduced strong typing, modern syntax, and improved performance compared to PHP 7.x, but upgrading can require code changes to handle removed behaviors and new strictness.
Below we summarize the new features in PHP 8.4, outline how 8.4 differs from earlier 8.x releases, and discuss the benefits and trade-offs (including performance) of moving to the newest version.
New features in PHP 8.4: The 8.4 release adds a number of significant capabilities.
Notably, Property Hooks allow classes to define “get” and “set” hooks on properties. This means you can attach short callables that run automatically when a property is read or written, reducing boilerplate getter/setter code.
class User {
public function __construct(private string $first, private string $last) {}
public string $fullName {
get => $this->first . " " . $this->last;
set { [$this->first, $this->last] = explode(' ', $value, 2); }
}
}
Here, \$fullName is a virtual property with custom get/set logic. Property Hooks let you “hook into the lifecycle of the property”, enabling logic on access or assignment.
In 8.4, you can also declare properties in interfaces and attach behavior to them, which was impossible before.
Another headline feature is Asymmetric Visibility. This lets you specify different visibility for reading vs writing a property.
For example, you could declare
public private(set) int $count;
to allow any code to read \$count, but only internal methods to set it. This provides more control over object state without needing full getters/setters.
Combined with hooks, asymmetric visibility adds powerful new object-design tools.
PHP 8.4 introduces new array utilities for searching: array_find(), array_find_key(), array_any(), array_all().
These functions take an array and a callback, and return the first matching value or key (array_find*), or test whether any/all elements satisfy a condition (array_any/array_all).
These additions make common patterns more concise and mirror utilities found in other languages and modern PHP libraries.
A usability enhancement in 8.4 is omitting parentheses on a new instance. Previously, writing (new Class)->method() required an extra pair of parentheses.
request = new Request()->withMethod('GET')->withUri('/hello-world');
Now you can simply write: request = new Request()->withMethod('GET')->withUri('/hello-world'); This makes fluent builder patterns more natural and code more readable.
The JIT (Just-In-Time) compiler, introduced in PHP 8.0, continues to be improved in 8.4.
Internals developer Dmitry Stogov rewrote the JIT on an intermediate representation for maintainability.
These changes are backward-compatible.
Real-world performance gains from JIT remain modest for most web apps, but the tweaks in 8.4 may benefit CPU-heavy or specialized use cases, especially if JIT is explicitly enabled.
PHP 8.4 finally adds full HTML5 support to the DOM extension.
Previously, the DOM parser only understood HTML4.01.
In 8.4, a new HTML5-capable parser and namespace were introduced, so DOMDocument now works with modern HTML out of the box.
This is a major improvement for web developers manipulating HTML via DOM APIs.
Other enhancements in PHP 8.4 include: support for \$_POST and \$_FILES on additional HTTP verbs (PUT, PATCH, DELETE, etc), new multibyte-safe trim functions (mb_trim(), etc), clearer rounding mode constants for round(), driver-specific PDO subclasses, better callbacks for DOM/XSL extensions, a new #[Deprecated] attribute for annotating functions or classes, and “lazy object” support (for proxy or ghost objects).
These features help frameworks and libraries and improve developer experience.
How PHP 8.4 compares to previous 8.x releases:
PHP 8.3 (Nov 2023)PHP 8.2 (Dec 2022)PHP 8.1 (Nov 2021)PHP 8.0 (Nov 2020)
PHP 8.3 (Nov 2023): Focused on polish and consistency. Notable features:
Typed Class Constantsjson_validate()Random\Randomizer methodsmb_str_pad()#[\Override] attributealiasing with class_alias()
Mosty cleanup and modernization.
PHP 8.2 (Dec 2022): Notable additions
Readonly ClassesDisjunctive Normal Form typesstandalone false/true/null return typestrait constantsdeprecating dynamic properties
PHP 8.1 (Nov 2021): Introduced
Enumerations (enums)Fibersintersection typesnever return typereadonly propertiesarray_is_list()FSync APIfirst-class callable syntaxfinal class constants
PHP 8.0 (Nov 2020): Launched the series with
Union Typesnamed argumentsattributesmatch expressionnullsafe operatorJIT
Performance: Each PHP update brings incremental speed and memory improvements.
Moving from PHP 7.4 to any 8.x gives a noticeable boost. Kinsta’s 2024 benchmarks found PHP 8.3 the fastest tested version, often significantly outperforming older versions in CMSs like WordPress, Laravel, Symfony, and CodeIgniter (up to ~52% faster in some scenarios).
However, Tideways’ data showed little difference between 8.2, 8.3, and 8.4 for typical web apps; the greatest performance boosts come from code optimization and caching rather than PHP upgrades alone.
Still, using the latest PHP is usually best for both speed and security.
The new features and stricter typing in PHP 8.4 bring more robust, self-documenting, and maintainable code.
Developer productivity is improved via concise new functions and constructs.
Performance is generally as good or better, and security is improved as legacy insecure behaviors are deprecated.
Modern PHP versions also benefit from longer support cycles, with each release supported for 4 years (2 years of full support, 2 for security updates).
Cons (Considerations): Upgrading to PHP 8.4 can introduce migration work, especially for codebases that rely on now-deprecated or changed behaviors (e.g., dynamic properties, untyped properties, curly-brace array syntax).
Developers must review breaking changes and adapt code and libraries.
JIT compilation is not always beneficial for all apps.
Some features, like Property Hooks and stricter typing, add complexity and require learning new patterns.
Older libraries or frameworks may lag in compatibility with the latest PHP.
Performance-wise, PHP 8.x is generally fast, but don't expect dramatic improvements with every minor release.
JIT compilation especially may not benefit all workloads and can use more memory.
Upgrading to the newest PHP alone is not a magic pill for speed; other factors like optimized code, caching, and hardware matter more.
Nonetheless, the latest PHP keeps performance at least as good, and is safest for support and security.
PHP 8.4 and the 8.x series represent a mature, high-performance language with modern safety features and maintain PHP’s ease of use.
The advantages—speed (in many real-world scenarios), richer language tools, and enhanced security—typically outweigh upgrade costs.
Benchmarks support upgrading, with up to 52% faster response rates on common CMSs using PHP 8.3 versus older versions.
Best practice: keep PHP updated, test applications, and handle deprecations promptly. Always use the latest PHP for optimized performance and security.
PHP 8.5 (due Nov 2025)
Looking ahead, PHP 8.5 (due Nov 2025) promises even more improvements (async/await, more property/attribute options, etc).
Information is drawn from official release notes, authoritative blogs, PHP.net announcements, the Zend PHP blog (for 8.4 and 8.3 features), developer sites like Laravel News and Phoronix for 8.1/8.2, and performance reports by Kinsta and Tideways.
These references detail feature differences, document new additions, and provide measured performance impacts to aid in decision-making.
Top comments (0)