Stop the pain, upgrade to PHP 7
Tags: applications, php, programming, php7
Published: 2017-12-13 00:17:59

---
title: "Stop the pain, upgrade to PHP 7"
published: true
tags: applications,php,programming,php7
canonical_url: 
cover_image: http://www.geekyboy.com/wp-content/uploads/2017/10/php7-elroubio.jpg
---

When I was young I played football at my local middle school…very terribly. I didn’t enjoy running with the heavy pads in the heat, and I definitely didn’t enjoy running into and hitting the other kids, most of which were larger than me. But in high school that all changed. Why? Because in middle school football was painful. Meanwhile in high school, well, it was still painful but there was something more pleasurable to offset the pain. It was the praises from the coach and the sounds of people cheering my name that truly made the difference.

See, in middle school, the coach seemed to focus more on the larger kids who could bully others, or the popular kids whose parents were the cornerstone of our small community. However, in 9th grade, it changed a bit because the coach was great at distributing his attention to the entire team. He would tell me “good job”, or “you can do better”, and he even let me play a game while my skills were catching up. These are things I didn’t have before, and it made a huge difference. I came to love playing and worked harder than I ever had to stay first string all season long rather than being satisfied with sitting on the sidelines watching others play.

So, now you may be asking, “What does this have to do with upgrading to PHP version 7?” The answer, because many are letting the pain of moving to PHP 7 prevent them from experiencing the pleasure and rewards.

[![](http://www.geekyboy.com/wp-content/uploads/2017/10/php7-elroubio.jpg)](http://www.geekyboy.com/wp-content/uploads/2017/10/php7-elroubio.jpg)

**PHP version 7.0 was released almost 2 years ago.** (1 year 10 months to be exact.) And many are still running PHP version&nbsp;5._something_. As a matter of fact, PHP version 7.0 is already going to run out of active community support in&nbsp;only 1 month and will only receive security fixes for another year after that.

You can see the supported versions of PHP at&nbsp;[http://php.net/supported-versions.php](http://php.net/supported-versions.php)

**The Pains**

I get it. Upgrading to a new major version is painful. There are backward compatibility issues that caused it to be a new major version, to begin with, and now we need to jump through some hoops without any good reason. I mean, the app already works, right?

Add to this that there may be compatibility issues that have nothing to do specifically with PHP, but rather the individual libraries and packages we used in the past&nbsp;have not updated yet. Dependency hell is only a step away.

Also, how can we possibly endure the pain of explaining why we should upgrade to PHP version 7+ to management!?!

So we should just give up. Perhaps remaining on PHP 5.4, 5.5, or 5.6 is not so bad after all.

NO WAY! Read on!

**Acclimation**

Those pains aside, there are more that we’ve become acclimated to over time. We avoid upgrading because we’ve become used to the pain faced on a daily basis with what we currently have. It has become our comfort level. Meaning, we avoid the pleasures of advancing because we settle for what we already know.

**Pleasure**

In case you haven’t heard, PHP 7 brings a whole new level of _FAST_. Some companies have even recorded speeds of some apps to double. You read that right, “Double the speed in some apps.” That means customers get served web pages in half the time. Internal employees are able to navigate intranets, accounting software, and other internal apps in half the time. Imagine the productivity gains and reductions in salary required to have employees sitting at a screen waiting for the next page to come up. Imagine the customers who don’t click away from our products because it now loads faster!

In addition, many companies also noticed their resources (servers) running PHP apps with PHP 7 have dropped drastically. (about half) Meaning they can serve the same PHP applications on half the number of servers they used previously. If a company was using 100 servers to do business, they are now able to do the same thing with only 50 servers! That is a saving of 50 fewer servers needing to be hosted. Imagine the carbon footprint impact of that!

_Note: Your mileage may vary, but many have shared real-time stats on this._

Some supporting posts and stats:

- [HHVM vs PHP 7](https://kinsta.com/blog/hhvm-vs-php-7/)
- [Drupal and WordPress on Pantheon](https://pantheon.io/blog/php-7-easiest-performance-optimization-i-ever-made)
- [Whitepaper from Rogue Wave and Zend](http://resources.roguewave.com/Maximize_Performance_PHP_7.html)
- [A Symfony 3 benchmark from PHP 5.6 to 7.0](https://www.cloudways.com/blog/php-5-6-vs-php-7-symfony-benchmarks/)
- [A Larevel 5.4 benchmark from PHP 5.6 to 7.0](https://dzone.com/articles/php-56-vs-php-7-performance-benchmarks-with-larave)
- [Infographic of many PHP apps and their benchmarks](http://www.zend.com/en/resources/php7_infographic)

There are other pleasures of upgrading to PHP version 7.0. Among them are new features in the PHP language, such as&nbsp;[scalar type declarations](http://php.net/manual/en/migration70.new-features.php#migration70.new-features.scalar-type-declarations), [return type declarations](http://php.net/manual/en/migration70.new-features.php#migration70.new-features.return-type-declarations),&nbsp;[null coalescing operator](http://php.net/manual/en/migration70.new-features.php#migration70.new-features.null-coalesce-op), [spaceship operator](http://php.net/manual/en/migration70.new-features.php#migration70.new-features.spaceship-op), [constant array using define()](http://php.net/manual/en/migration70.new-features.php#migration70.new-features.define-array), [anonymous classes](http://php.net/manual/en/migration70.new-features.php#migration70.new-features.anonymous-classes),&nbsp;[Unicode codepoint escape syntax](http://php.net/manual/en/migration70.new-features.php#migration70.new-features.unicode-codepoint-escape-syntax),&nbsp;[Closure::call()](http://php.net/manual/en/migration70.new-features.php#migration70.new-features.closure-call-method),&nbsp;[Filtered unserialize()](http://php.net/manual/en/migration70.new-features.php#migration70.new-features.filtered-unserialize), [IntlChar](http://php.net/manual/en/migration70.new-features.php#migration70.new-features.intlchar), [Expectations](http://php.net/manual/en/migration70.new-features.php#migration70.new-features.expectations), [Group use Declarations](http://php.net/manual/en/migration70.new-features.php#migration70.new-features.group-use-declarations), [Generator Return Expressions](http://php.net/manual/en/migration70.new-features.php#migration70.new-features.generator-return-expressions), [Generator Delegation](http://php.net/manual/en/migration70.new-features.php#migration70.new-features.generator-delegation), [Integer division with](http://php.net/manual/en/migration70.new-features.php#migration70.new-features.intdiv)intdiv(), [Session options](http://php.net/manual/en/migration70.new-features.php#migration70.new-features.session-options), [preg\_replace\_callback\_array()](http://php.net/manual/en/migration70.new-features.php#migration70.new-features.preg-repace-callback-array-function), and [CSPRNG functions](http://php.net/manual/en/migration70.new-features.php#migration70.new-features.csprng-functions)

The upgrade to PHP version 7.1 brings pleasures in the form of even more performance improvements, as well as, [Nullable types](http://php.net/manual/en/migration71.new-features.php#migration71.new-features.nullable-types), [Void functions](http://php.net/manual/en/migration71.new-features.php#migration71.new-features.void-functions), [Symmetric Array Destructuring](http://php.net/manual/en/migration71.new-features.php#migration71.new-features.symmetric-array-destructuring), [Class Constant Visibility](http://php.net/manual/en/migration71.new-features.php#migration71.new-features.class-constant-visibility), [iterable pseudo type](http://php.net/manual/en/migration71.new-features.php#migration71.new-features.iterable-pseudo-type), [multi-catch exception handling](http://php.net/manual/en/migration71.new-features.php#migration71.new-features.mulit-catch-exception-handling), [support for keys in list()](http://php.net/manual/en/migration71.new-features.php#migration71.new-features.support-for-keys-in-list), [support for negative string offsets](http://php.net/manual/en/migration71.new-features.php#migration71.new-features.support-for-negative-string-offsets), [convert callables to closures](http://php.net/manual/en/migration71.new-features.php#migration71.new-features.convert-callables-to-closures), [asynchronous signal handling](http://php.net/manual/en/migration71.new-features.php#migration71.new-features.asynchronous-signal-handling), and [HTTP/2 server push support in ext/curl](http://php.net/manual/en/migration71.new-features.php#migration71.new-features.http2-server-push-support-in-ext-curl)

And PHP version 7.2 also looks to carry many more great things, as PHP 7.3 is gaining form.

**In Closing**

Yes, there may be a little pain in upgrading to PHP 7, but overall the good parts far outweigh the pain. You’ll be glad you did it.

What are you waiting for? Get out there and feel good by upgrading your apps and servers to PHP 7 today!

Not to make this a sales pitch, but if you need any help upgrading, let me know. My team at [Rogue Wave](http://www.zend.com/en/services/application-audit-and-migration) are here to help.

There is a great recorded webinar sharing more thoughts on [migrating to PHP 7](http://blog.zend.com/2017/09/14/webinar-recap-avoiding-php-migration-hiccups/).

Happy PHP’ing!