PHP 8.4 was released in November 2024. Its headline features make object code shorter and clearer: property hooks and asymmetric visibility. A handful of smaller additions round out the release, and PHP 8.5 followed in November 2025, so teams often upgrade through 8.4 on the way.
Property hooks
A property can now carry its own get and set logic, without writing separate getter and setter methods.
class User {
public string $name {
set => trim($value);
}
public string $display {
get => strtoupper($this->name);
}
}
Hooks validate or transform values at the point of assignment and keep the public surface a plain property.
Asymmetric visibility
You can now give a property different visibility for reading and writing, for example public read and private write.
class Order {
public private(set) string $status = 'new';
}
Callers can read $order->status but only the class changes it. That replaces many read-only getters.
Other additions worth knowing
| Feature | What it gives you |
|---|---|
array_find, array_any, array_all | Search and test arrays without a manual loop |
new without extra parentheses | new Foo()->bar() works directly |
| New HTML5-capable DOM API | Better parsing of modern HTML |
#[\Deprecated] attribute | Mark your own functions as deprecated |
| Implicit nullable types deprecated | Write ?string $x = null explicitly |
Upgrade tips
- Run your test suite on 8.4 and read the deprecation notices.
- Update frameworks and packages first, since most added 8.4 support already.
- Fix implicit nullable parameter types, the most common warning.
- Test on staging with the same extensions as production.
Where to run it
Standard sites run on web hosting when the panel lets you pick the PHP version. When you need custom extensions, Composer-managed deployments or background workers, use a cloud server. Newer PHP versions are also faster for WordPress, as covered in WordPress hosting in Europe.
Frequently asked questions
Are property hooks a replacement for getters and setters?
They cover simple cases cleanly. Keep methods when the logic needs several parameters or a name that explains the action.
Will my old code break on 8.4?
Mostly it runs, with deprecation notices to fix. Check the implicit nullable parameter notices first.
How long is PHP 8.4 supported?
Active support runs about two years from release, with security fixes for a further two. Check php.net for the exact dates.




