PHP 8.4 Is Out: What It Means for Your Business Website

PHP 8.4 landed this month with property hooks, asymmetric visibility and a long list of deprecations. Here's what matters if you're not a developer, and what your developer should check.

PHP 8.4 Is Out: What It Means for Your Business Website

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() and array_all(). Small but handy.
  • You can call methods on new without wrapping it in brackets, so new 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:

  1. Check the framework and every plugin or package for stated compatibility.
  2. Run the site on a staging copy with the new version and error logging turned up.
  3. Click through the important journeys: contact forms, checkout, login, admin.
  4. Watch the error log for deprecation notices for a few days.
  5. 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.

Y
Written by the YPage Technologies team

We design and build websites, web applications and SaaS products for growing businesses, and share what we learn along the way.

Work with us

Ready to start your next project?

Let's talk about your website, web app or digital product.

Get in touch