PHP 8.4 was officially released in November 2025, bringing a host of new features that make the language more expressive and developer-friendly than ever.
Property Hooks
One of the most anticipated features, property hooks allow you to define get and set behavior directly in property declarations:
class User {
public string $fullName {
get => $this->firstName . ' ' . $this->lastName;
set => [$this->firstName, $this->lastName] = explode(' ', $value, 2);
}
}
This eliminates the need for boilerplate getter and setter methods in many cases.
Asymmetric Visibility
Properties can now have different visibility for reading and writing:
class BankAccount {
public private(set) float $balance = 0.0;
}
New Array Functions
PHP 8.4 adds several useful array functions:
array_find()- Find the first element matching a conditionarray_find_key()- Find the key of matching elementarray_any()- Check if any element matchesarray_all()- Check if all elements match
HTML5 Support in DOM
The new Dom\HTMLDocument class provides proper HTML5 parsing support, a long-awaited improvement for web scraping and manipulation tasks.
Upgrade Considerations
Before upgrading, review the migration guide for deprecated features and breaking changes. Most Laravel and Symfony applications should upgrade smoothly.
PHP continues to evolve as a modern, type-safe language suitable for enterprise applications.