Innovate faster and cut risk with PHP experts from Zend Services.
Learn PHP from PHP experts with free, on-demand, and instructor led courses.
Submit support requests and browse self-service resources.
With PHP 7.4 now end of life, teams with applications built on PHP 7.4 are quickly planning and executing their migration to a community-supported version. But are there considerations teams need to make when migrating PHP 7.4?
In this blog, we look at considerations for teams migrating off PHP 7.4, including backwards compatibility, deprecated features, potential PHP 7.4 to 8 migration paths, and what teams can do if they're not able to migrate before PHP 7.4 reaches end of life.
Because PHP 7.4 is the terminal release for the PHP 7.x series, migrating PHP 7.4 requires users to migrate to a new major version of PHP, PHP 8. With this jump to a new major version, there is typically an increased number of considerations, including backwards incompatibility, deprecated features, and other changes.
When you migrate to a new major version, the chances of experiencing issues with backwards incompatibility goes up. For teams moving from PHP 7.4 to PHP 8, there is a long list of changes that might impact your applications. They range from changes to the core language, to how objects within the language are treated, to the removal and deprecation of features and functions. You can view the full list of backwards incompatible changes here.
There are a number of features that previously appeared in PHP 7.4 that are deprecated in PHP 8. The deprecated features list for PHP 8.0.x can be found here.
Any other changes that might impact teams migrating from PHP 7.4 to PHP 8 can be found in the "Other Changes" list.
Start Planning Your Next PHP MigrationIn this free white paper, our experts provide insights on the best practices for planning and executing successful PHP migrations and upgrades.Download for Free
In this free white paper, our experts provide insights on the best practices for planning and executing successful PHP migrations and upgrades.
Download for Free
Now that PHP 8.1 and PHP 8.2 are available, most teams will be migrating from PHP 7.4 directly to 8.1 or 8.2 -- with most leaning toward the latest release.
Read our migration services case study with Bark.com >>
As noted in our blog covering the new features and improvements in PHP 8.0, there are a number of syntactical improvements that simplify boilerplate, with some very handy expansions to the type systems. The PHP JIT compiler, although a banner feature for the release, probably won't be the reason why teams migrate from PHP 7.4 to 8 or 8.x versions (at least until there are mature libraries and applications that take advantage of it).
As noted above, major version changes bring about a number of backward incompatibilities, meaning that teams will need to spend time reviewing their code. Luckily, there are a few tools that can give you a head start when performing your thorough testing, like the PHP Compatibility Coding Standard for PHP CodeSniffer.
Read our breakdown of the new features in PHP 8.0 >>
For teams who want to migrate to the latest version of PHP (as of September 29, 2022), the migration path would typically run from PHP 7.4 directly to PHP 8.1. PHP 8.1 introduced a few new features, changes, and deprecations to watch out for, so be sure to read the full release notes and upgrade notes.
As we noted in our blog detailing the new features in PHP 8.1, teams will want to consider PHP 8.1 or 8.2 if they want to take advantage of the improvements to the object model, or the async capabilities of fibers. Teams upgrading to 8.1 will want to watch out for changes to mysqli error mode, and how values are tied to other types when strict types are enabled.
Read our breakdown of the big changes in PHP 8.1 >>
PHP 8.2, now a full general availability release, will be a popular destination for teams migrating off PHP 7.4
Teams might consider PHP 8.2 over 8.1 or 8.0 if they are interested in readonly classes, standalone types, or want slightly better performance. If you are considering a move to PHP 8.2, be sure to read the migration notes provided at php.net.
Read our breakdown of the changes to watch in PHP 8.2 >>
For teams migrating particularly complex or numerous PHP applications, migrating your applications to supported PHP versions before they reach end of life might not always be possible or cost-effective. But that doesn't mean that teams can roll the dice on unsupported PHP in their applications. Teams that use unsupported PHP in production risk exposing their applications and data to unpatched vulnerabilities.
To prevent exposure to those vulnerabilities, teams need to have a plan in place for patching vulnerabilities as they arise — whether that's building patches in house, or working with a third party LTS provider like Zend.
See our PHP LTS options >>
With PHP 7.4 reaching end of life at the end of November, teams who haven't already planned a migration need to start planning and execute their migration strategy, or find a way to support their EOL PHP.
That said, if it makes business sense for your team to migrate your application(s) onto a newer, supported PHP version, they should. When they do, they are likely to enjoy a number of new features, improvements, and potential cost savings that come with it.
See Our PHP LTS and Migration Service OptionsWhether you need to migrate PHP-based applications to a new version, or find extended long-term support to keep your applications safe and secure, Zend can help. See what we offer via the links below.See LTS Options See Migration Services
Whether you need to migrate PHP-based applications to a new version, or find extended long-term support to keep your applications safe and secure, Zend can help. See what we offer via the links below.
See LTS Options See Migration Services