PHP 8.4 - Is the update worth it?

27.02.2025
PHP 8.4 - Is the update worth it?

PHP 8.4 is here! The new version not only brings more performance and security, but also makes development more efficient. In this article, you will find out why the update is worthwhile and which new functions will make your work easier.

PHP 8.4 takes the language to a new level: better performance, more security and more flexibility for developers, agencies and website operators. We'll show you what possibilities this opens up for your projects.

PHP PHP | Source: Canva

New features and improvements

PHP 8.4 brings some new features that will make your code cleaner and your applications more efficient. Let's take a look at the most important new features:

Property hooks: control over property access

With property hooks, you can create calculated properties more easily and perform pre- and post-processing of properties - for example, before a value is written to the database or before a value is delivered via the API - without any explicit getters or setters. This makes read and write access to properties more efficient and flexible.

Advantages of property hooks:

  • No additional boilerplate code for getters and setters
  • Possibility of dynamic calculation of properties
  • Simple implementation of pre- and post-processing

Example:

class DynamicProperties {
    public int $dynamicValue {
        get => rand(1, 100);
    }
    public string $timestamp {
        get => date('Y-m-d H:i:s');
    }
}

$obj = new DynamicProperties();
print $obj->dynamicValue . “\n”; // Output: A random number
print $obj->timestamp . “\n”; // Output: Current date and time

Asymmetric visibility for properties

In PHP 8.4 you can now set read and write permissions for properties separately.

Why is this useful?

  • Write access can be restricted while read access remains possible.
  • It reduces the need for additional getter methods.

Advantage: Security is increased and code maintenance is made easier.

Example:

class PhpVersion
{
    public string $version { get; private set; } = '8.4';

    public function increment(): void
    {
        [$major, $minor] = explode('.', $this->version);
        $minor++;
        $this->version = "{$major}.{$minor}";
    }
}

$phpVersion = new PhpVersion();
print $phpVersion->version . “\n”; // Read access is allowed - no getter function necessary
//$phpVersion->version = “9.0”; // Error: Write access is not allowed

Lazy objects: more efficient memory utilization

Lazy objects improve memory management by initializing objects only when they are actually needed.

Advantage: Lazy objects reduce memory consumption and accelerate data-intensive applications.

Example:

use Symfony\Component\VarExporter\LazyObject;

$lazyUser = LazyObject::create(fn() => new User('admin', '12345'));
echo $lazyUser->username; // The user object is only initialized here

[\Deprecated] attribute: Structured code migration

The new #[\Deprecated] attribute helps developers to cleanly remove old functions from the code by issuing warnings for obsolete methods.

How does this help?

  • Developers are informed about deprecated functions at an early stage.
  • Migration to new methods is facilitated step by step.

Advantage: Ideal for long-term maintenance and a clean code base.

Example:

#[\Deprecated(reason: “Use the new method xyz() instead.”)]
function alteFunktion() {
    // Deprecated logic
}

New array functions: More efficient data processing

PHP 8.4 introduces array_find(), a new way to quickly find values in arrays - without array_filter() or foreach loops.

Advantage: Improves readability and saves computing time with large amounts of data.

Example:

$values = [10, 20, 30, 40, 50]; 
$firstMatch = array_find($values, fn($value) => $value > 25); 
echo $firstMatch; // Output: 30

Improved DOM HTML5 parser

The DOM parser now processes HTML5 more precisely and recognizes faulty code more reliably.

Advantage: Makes it easier to work with HTML documents in CMS systems and web crawlers.

OPcache optimizations: Faster loading

Thanks to new OPcache optimizations, scripts are cached more efficiently, which shortens loading times.

Advantage: Improved performance without additional configuration effort.

More new features coming soon

PHP 8.4 also brings

  • a simplified syntax for object creation,
  • extended curl functions and
  • better support for multibyte strings.

Non-backward compatible changes

In PHP 8.4, some functions have been marked as deprecated because they will be removed in future versions. While they currently still work, developers should adapt their applications early to avoid potential problems with later PHP versions.

Dynamic class properties

Previously in PHP it was possible to define dynamic properties in classes without explicitly declaring them. While dynamic properties provide flexibility, they can lead to unexpected errors and inconsistent behavior. In PHP 8.4, the use of dynamic class properties is deprecated. Developers should use get and set or declare the properties explicitly in the class.

PHP 8.4 and compatibility with popular applications

An update to PHP 8.4 brings more performance, security and new functions for modern web applications.
But before you switch, you should make sure that your CMS, store system or plug-ins are compatible.

If your CMS or shop system is incompatible, this can lead to:

  • Malfunctions and unexpected behavior,
  • crashes or pages not loading and
  • incompatible plug-ins that need to be deactivated.

Tip: Check compatibility in advance - especially if you use a lot of extensions.

Compatibility table: PHP 8.4 & CMS / store systems

Store system / CMSCompatibilityNote
Magento 2No official confirmation for PHP 8.4 in the documentation. Version 2.4.8 does not contain any information about PHP 8.4. Source: Experience League
Shopware 6According to official documentation no confirmed support for PHP 8.4.
TYPO3According to the official roadmap compatible from version 12 and 13.
WordPress / WooCommerce⚠️WordPress 6.7 only offers “beta support” for PHP 8.4. Use in productive systems not recommended.
DrupalAccording to the documentation only versions 10.4 and 11.1.
OroCommerceDocumentation for version 6.0 only mentions support for PHP ≥ 8.3. No confirmation for PHP 8.4

Other applications and their compatibility with PHP 8.4

In addition to the well-known store systems and CMS, there are also numerous other applications that are compatible with PHP 8.4.

ApplicationCompatibilityNote
Matomo (Piwik)As of version 5.2.0 compatible with PHP 8.4.
TidewaysFully compatible with PHP 8.4.

Important notes on compatibility

  • Check for regular updates
    Many CMS and store systems publish subsequent updates for new PHP versions. Keep up to date with official announcements.
  • Test plug-ins
    Even if your system supports PHP 8.4, third-party plug-ins may be incompatible. Test them in a development environment before updating.
  • Contact hosting provider
    Make sure that your server supports PHP 8.4 and that all necessary settings have been made.

EOL and roadmap of current PHP versions

To keep your applications secure, performant and compatible, you should keep an eye on the end-of-life (EOL) dates for PHP versions. As soon as a version no longer receives support, there are no official security updates - a risk for your applications.

Official roadmap and support data

PHP versionActive supportSecurity supportStatus
PHP 7.4EndedEndedNo more official updates
PHP 8.0EndedEndedNo more official updates
PHP 8.1EndedUntil 12/31/2025Security updates only
PHP 8.2EndedUntil 12/31/2026Security updates only
PHP 8.4Until 12/31/2026Until 12/31/2028Latest version

Why is the roadmap important?

  • Ensure security: Outdated versions such as PHP 7.4 or 8.0 no longer receive security updates and are vulnerable to attacks.
  • Use the latest features: With each new version, performance, security and functionality improve.
  • Better planning: If you are thinking long-term, you should upgrade to the latest version early to avoid stress later on.

Important steps before the update

To ensure that the update runs smoothly, please note the following points:

  • Check compatibility. Make sure that your CMS, plug-ins or frameworks support PHP 8.4. Check the documentation of your hosting provider.
  • Create a full backup of your database and files. If something goes wrong, you can quickly revert to the previous version.
  • Use a test environment. Implement PHP 8.4 in a test environment first to detect errors early.
  • Adjust code. Check the code for obsolete functions and use the PHP migration guide.
  • Check server settings. Make sure your server supports the required modules and configurations for PHP 8.4.
  • Long-term thinking. If you are still using PHP 7.4 or 8.0, you should upgrade to a newer version immediately due to security issues. Are you planning long-term projects? Then go straight to PHP 8.4 to get security updates until the end of 2028.

Successful update to PHP 8.4: How to prepare yourself optimally

The update to PHP 8.4 brings numerous benefits such as improved performance, new features and increased security. To ensure that the changeover goes smoothly, you should consider a few important steps. Here you can find out how to set up PHP 8.4 individually and use it optimally at maxcluster.

Individual setup of PHP 8.4

If you are not using managed hosting, you can install PHP 8.4 manually on your server. Depending on your operating system, there are various options that you can implement using the following resources:

Tips for a successful installation

1 Create a backup: Back up your environment so that you can fall back to an earlier version in an emergency.
2 Set up a test environment: Make sure your code and applications work properly with PHP 8.4 before updating the live environment.
3 Check dependencies: Check all plugins, libraries and extensions for compatibility with PHP 8.4 to avoid unexpected errors.

Setting up PHP 8.4 at maxcluster

Setting PHP 8.4 for a domain in the Application Center Setting PHP 8.4 for a domain in the Application Center by maxcluster | Screenshot: maxcluster

At maxcluster you can easily install PHP 8.4 on all Ubuntu clusters from 14.01.2025. To use the new version, simply activate it for the desired vHost in the Application Center. We have made the process user-friendly and transparent so that you can easily upgrade to PHP 8.4.

You can activate PHP 8.4 for your domains in the Application Center and switch between different PHP versions as required - a flexibility that is not a given everywhere!
Our team will guide you through the entire upgrade and ensure that everything runs smoothly - from activation to full integration.

If you have any questions or need support, you can contact our support team at any time: support@maxcluster.de or +49 5251 4141 30

Conclusion

PHP 8.4 brings many practical improvements. Property hooks, lazy objects and optimized OPcache management in particular make development more efficient. Check the compatibility of your system before updating to ensure a smooth transition.
Good preparation will help you to take advantage of all the benefits of PHP 8.4 and keep your applications stable and future-proof.


Published on 02/27/2025 | PHP 8.4 - Is the update worth it? | KS

You have questions, requests, criticism, suggestions or just want to tell us your opinion about our blog? Here you have the opportunity to contact us directly.

Send e-mail