PHP 7.2 came out in November 2017 and 7.0 was launched nearly 2 years prior. 2016 was a sort of “burn in” period for PHP 7. We saw popular open source libraries work to be compatible and early adopters use it for new projects and side projects. In 2017 we saw lots of folks embrace PHP7 on larger projects including us.
It’s 2018 now, what are you waiting for? If you aren’t using PHP 7 you should be!
Modern frameworks are embracing 7 as well as enterprise apps. It’s now considered stable and mainstream. Lets take a quick look at the new features in 7 that are inspiring this embrace.
The latest versions of these frameworks and platforms support PHP 7 and in many cases require version 7.0 or higher.
If you are starting a new project and your framework supports 7.2 start with 7.2. It’s a great starting point for fresh apps.
If you are migrating a legacy app and your new (or upgraded framework) supports 7.2 then you should weigh the time needed to update the custom code to 7.2. If it is a later version of PHP 5 it’s worth migrating the code. In many cases very little code will need to change. If you are using a deprecated feature set you may need to spend more time upgrading that feature or removing libraries in favor of new ones.
For Magento 2, you should run 7.1. As of earlier this year I had difficulties running with 7.2. There were a few deprecated libraries including mcrypt, still being used. I hope it will be 7.2 compatible later this year.
If you are running out of the box WordPress use PHP 7.2. If you are running the latest version of WordPress but have a lot of 3rd party plugins you will need to check to see if they are compatible. You could see a ~20% improvement in performance (reference).
It’s time to upgrade to 7 if you haven’t already. PHP 7 has far greater performance, security and lots of new features for your team to explore.
BTW If you are using mcrypt, stop, switch to OpenSSL or Sodium. Mcrypt was a very handy package years ago, but it no longer maintained and is clunky.
Tags: performance, php7, upgrade
Categories: PHP, Programming
Lets talk!
Join our mailing list, we promise not to spam.