A dilemma we are facing today is that many businesses, developers, and hosts have fallen behind when it comes to supporting the latest PHP versions. Some of the statistics below might even shock you. Today we want to discuss some of the reasons why it is so important that everyone uses the latest PHP versions, not only for security reasons but also for better performance and support.
Why the Slow Adoption of Newer Versions?
The main reason for the lack of faster adoption for new versions most likely comes down a few different factors:
- The number one reason we see from new customers that migrate to Kinsta is that business owners donât know or care about their PHP version. This, of course, is understandable in some cases as we donât expect everyone to know this. Many times this responsibility falls on the developer, agency, or host.
- It takes time for developers to update their code to support newer versions of PHP. This includes those that develop websites, themes, plugins, etc.
- Not only does it require effort and time to update code, it also can require extensive testing to ensure compatibility. The WordPress repository alone has over 49,000 plugins!
- Many WordPress hosts have been reluctant to push out updated PHP versions because this could end up resulting in additional support tickets if it breaks a site. As a WordPress host, we definitely understand this, but from our experience, this is typically the other way around. Many support issues we see are from issues caused by older PHP versions.
- The developer or agency might be stuck between a rock and a hard place when dealing with a client and other 3rd party applications they are unwilling to spend resources on updating.
Reasons Why You Should Update PHP Versions
Check out some of the reasons below why you should think about updating if you havenât already.
1. Security
One of the most important reasons to update PHP is to ensure you are running on a version that is fully supported and patched regularly for security vulnerabilities. PHP 5.4 has not been patched since 2015. And PHP 5.5 has not been patched since 2016. It is important to note though, that some operating system vendors still update older versions of PHP if they included it.
2. Performance
With the release of  PHP 7.2, 7.3, and 7.4 came huge performance gains! So big in fact, that it should be a priority over a lot of the small optimizations you might playing around with on your WordPress site.
3. Support
Support is another reason why you want to use the latest and supported PHP versions. Many times, developers of plugins and themes can only extend support back for older versions so far. A lof this is due to time constraints and not having time to test compatibility. Things will eventually break when you run on old versions, and you can see this happening first hand in the WordPress forums.
4. New Features for Developers
Most WordPress developers would prefer to only work on newer versions of PHP if they could, simply due to the fact that there have been so many new features added between PHP 5.2 and PHP 7.4. A few changes with PHP 7 and 7.3 include:
- Combined comparison operator
- Null coalesce operator
- New type hinting
- Anonymous classes
- Nullable types
- Iterable and void returns
- Multi-catch exception handling
- Keys usable in lists