PHP 8.4 was released in late November, and if your website runs on WordPress, Laravel, CodeIgniter or almost any custom PHP application, it affects you sooner or later. Most of our clients don't care about language features, and they shouldn't have to. But they do care about two things: is my site secure, and will it keep working?
So let's split this into two parts. The short version for business owners, and a slightly nerdier section for the developers.
For business owners
Each PHP version gets about two years of active support and then one more year of security fixes. After that, it's effectively abandoned. PHP 8.1 stops receiving security fixes at the end of 2025. If your site is still on 7.4 or 8.0, it's already running on software that no longer gets security patches.
You don't need to jump to 8.4 the day it comes out. In fact, we usually wait a few months for plugins and libraries to catch up. But you should have a plan to be on a supported version, and your hosting provider should let you switch versions from the control panel.
Ask your developer or agency one question: "Which PHP version are we on, and when does it go out of support?" If they can't answer quickly, that tells you something.
For developers
The headline feature is property hooks. You can now define get and set behaviour directly on a property, which removes a lot of boilerplate getters and setters. For simple value objects this is genuinely pleasant.
Asymmetric visibility lets you write public private(set) string $name, meaning anyone can read it but only the class can change it. We've wanted this for years.
Other changes worth knowing:
- New array functions:
array_find(),array_find_key(),array_any()andarray_all(). Small but handy. - You can call methods on
newwithout wrapping it in brackets, sonew Invoice()->send()now works. - Implicitly nullable parameter types are deprecated. If you've written
function foo(string $x = null), PHP will start warning you. Change it to?string $x = null. - A new DOM API that actually handles HTML5 properly.
Our upgrade checklist
When we move a client site to a new PHP version, we follow roughly the same steps:
- Check the framework and every plugin or package for stated compatibility.
- Run the site on a staging copy with the new version and error logging turned up.
- Click through the important journeys: contact forms, checkout, login, admin.
- Watch the error log for deprecation notices for a few days.
- Switch production, keep the old version available for quick rollback.
For a typical brochure site, this is a couple of hours of work. For a large WooCommerce store with thirty plugins, it can take a few days, mostly waiting on plugin authors.
Should you upgrade now?
If you're on 8.2 or 8.3, there's no rush. Plan the move to 8.4 for sometime in the first half of 2025. If you're on anything older than 8.1, upgrading should be on this quarter's to-do list, not next year's.
