What Shipped in PHP 8.4
PHP 8.4 was released in November 2024. Rather than sweeping syntax changes, it focused on developer experience improvements that eliminate common boilerplate. Three features stand out.
1. Property Hooks
Before PHP 8.4, custom get/set logic required separate accessor methods. PHP 8.4 lets you write the same thing inline:
class User {
public string $name {
set(string $value) => $this->name = trim($value);
}
}
The boilerplate reduction is substantial — especially in Laravel models and DTOs where accessors are common.
2. Asymmetric Visibility
PHP 8.1's readonly made properties fully immutable. PHP 8.4 adds per-access-level visibility:
class Order {
public private(set) int $status = 0;
// Readable from outside, writable only within Order
}
This is the pattern previously approximated with readonly plus workarounds. Now it is first-class syntax.
3. New Array Functions
PHP 8.4 adds four long-awaited array functions:
array_find()— returns the first element matching a predicatearray_find_key()— returns the key of the first matcharray_any()— true if at least one element matchesarray_all()— true if all elements match
These replace the verbose array_filter + reset or manual foreach patterns that were standard before.
Should You Upgrade?
PHP 8.1 security support ended in December 2025. PHP 8.0 and below no longer receive any updates. Running an older version in production means running known, unpatched vulnerabilities. PHP 8.4-ready hosting? Check our web hosting plans or cloud servers.
Will upgrading to PHP 8.4 break my existing code?
PHP 8.4 is conservative on breaking changes. The most notable is that some implicit null conversions now throw errors instead of deprecation warnings. Most applications migrate cleanly, but always test in a staging environment before deploying to production.
Are PHP 8.4 property hooks compatible with Laravel and Eloquent?
Yes. Property hooks are standard PHP syntax and fully compatible with Laravel. They can coexist with Eloquent accessors and mutators without conflict — they operate at different layers of the stack.
How much faster is PHP 8.4 compared to PHP 8.3?
PHP 8.4 delivers roughly 3-8% throughput improvement over 8.3 through JIT enhancements and internal optimisations. Small on paper, but meaningful for compute-heavy applications running at scale.