Here at Phoenix we’re in the middle of upgrading our websites to use PHP7 instead of PHP5.6. PHP5 has been the world’s most popular server scripting language for almost a decade now. The time has come to put the faithful old workhorse to pasture. Our website is already using PHP7 and reaping the benefits.
PHP7 introduces several new programming features, but the single greatest feature of PHP7 is its awesome performance improvements. In tests it executes its code 2-3x faster than PHP5. That doesn’t mean your website will load 2-3x faster, as there are many other activities that take place to put a web page in front of your eyes, but you will get a significant boost. I did an analysis of our website’s loading times comparing the server running PHP5.6 and then running PHP7.0. I used pingdom tools to get loading times. I also took a look at server waiting times using Google’s HAR Analyser to obtain the times from the pingdom tests. I turned off all PHP caching and WordPress caching plugins before running the tests. The results are as follows:
Comparing website load times between PHP 5 and PHP 7
||pingdom.com Load Time (s)
||HAR Wait Time (s)
Going by the pingdom tools load times that is a 25% smaller average loading time upgrading from PHP5.6 to PHP7.0. Not too shabby. Going by the average server wait time, the saving is 33.7%. Apparently 7.0 also uses less memory than 5.6 but I didn’t test that. If you’re interested, HAR files for the tests are downloadable right here.
Why upgrade PHP now? Why not earlier?
The first public release of PHP7 was in November 2015, almost a year at time of writing. We’ve waited until now to implement it because many WordPress plugin developers hadn’t updated their code to handle PHP7. PHP7 removes all deprecated functionality of PHP5 and makes some other backward incompatible changes. The result is that upgrading to PHP7 is only safe when the code has been prepared for it. The core WordPress development team made sure WordPress was compatible with PHP7 on the day of release. All the major WordPress plugins are now compatible with PHP7. At this stage a plugin which breaks with PHP7 is probably not worth using.
Incidentally, if you’re wondering what happened to PHP6, it does exist but it never left the experimental stage. PHP6 was an attempt to integrate unicode support into the language and was something of a failure. Development was abandoned in 2010. You can read more about PHP6 here.
If your web developer hasn’t yet transferred your website to PHP7 give them a nudge. There are plenty of upsides and no downsides to upgrading and the time has come.