<img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=278116885016877&amp;ev=PageView&amp;noscript=1">

, , , ,

May 10, 2016 | 3 Minute Read

Making Drupal 8 PHP 7 Ready Is Huge For Drupal 8 Developers

Table of Contents

Introduction

Drupal 8 developers, making Drupal 8 PHP 7 ready is one of the best things to happen for us. More than a reason to celebrate. That’s good news worth writing about because now Drupal 8 development is that much easier, compatible, and just better all around.

And think about it: PHP 7 being launched on December 3rd marks almost after 11 years since PHP 5 was released. Do you remember those days? Because I sure don’t; I was in 9th grade. Hope that doesn't make you feel old.

Yes, Drupal 8 developers: PHP 7 is fast.

All this excitement around PHP 7 providing a serious performance boost right out of the box, with new language features and more is well warranted. This will make learning Drupal 8 even more dynamic. So what’s changed? Here are four big ones:

1. PHP 7 receives a brand new version of the engine called phpng, coming under the codename: PHP#NG (Next Generation). The most easily recognizable advantage of this new PHPNG engine, which is new refactored of Zend engine, is the significant performance improvement: PHP 7 is now as fast as HHVM.

2. PHP 7 is up to twice as fast as PHP 5.6 because of new Zend Engine. Thanks to the new Zend Engine 3.0, your apps see up to 2x faster performance than PHP 5.6.

3. There's a 50% increase in memory consumption, significantly reducing memory usage.

4. Serve more concurrent users without adding any hardware.

And there’s much more. For a full list of major PHP 7 improvements, check out the news archive at php.net.

We’re seeing 30% to 110% performance gains!

PHP 7 provides nearly 100% compatibility with codebase; that means you can upgrade your server's old PHP's version and your same codebase should work without any difficulty, allowing you reap the performance benefits. PHP 7 claims to provide performance from 30% to 110% performance gain to major CMS systems like Drupal, Wordpress, SugarCRM, etc.

Making Drupal 8 PHP 7 ready is huge.

Although PHP 7 was launched just after two weeks of Drupal 8 official release, that didn't stop the Drupal community from supporting PHP 7. The community worked hard to make Drupal 8 PHP 7 compatible. In fact, making Drupal 8 PHP 7 compatible was one of the top goals of the Drupal community.

Currently, all commits for Drupal 8 core have to go through automated continuous integration testing for PHP 7 compatibility. It’s official. By using Drupal 8, you get full compatibility with PHP 7, and if you upgrade your PHP to version 7, you get at least a 30% speed increase without changing the code. That’s a huge benefit right out of the box.

One of the biggest reasons that made Drupal 8 developers support PHP 7 from the start was PHP 7's release road-map. PHP 7 was going to get released around the same time as Drupal 8’s  stable release, and the PHP community was going to make all PHP 5.x versions deprecated. That made supporting the latest PHP version all the more relevant. Now the Drupal community has gone ahead to run Drupal core tests on PHP 7 by default. We’re so serious about supporting PHP 7, that a compatibility bug found by the Drupal community caused PHP 7's release to be pushed forward by a whole month.

So I tested a few things out.

I ran some benchmarking tests, using ApacheBench on Drupal 8 with php5.6 and php7.0 on the same hardware for anonymous user loading the default homepage. In each test, 1000 sequential request were made. Here are my observations:

Drupal 8 on php5.6 with no caching:
Time taken for tests : 56.629 seconds
Requests per second: 17.66 (#/sec)
Time per request : 56.629 (ms)

Drupal 8 on php7.0 with no caching:
Time taken for tests : 32.075 seconds
Requests per second: 31.18 (#/sec)
Time per request : 32.075 (ms)

Drupal 8 on php5.6 with caching:
Time taken for tests : 7.071 seconds
Requests per second: 141.43 (#/sec)
Time per request : 7.071 (ms)

Drupal 8 on php7.0 with caching:
Time taken for tests : 5.400 seconds
Requests per second: 185.19 (#/sec)
Time per request : 5.400 (ms)

What's all this mean? PHP 7 really speeds things up. Drupal 8 without caching completed the test in 43.36% less time on php7.0 compared to php5.6. Drupal 8 without caching handled 76.56% more requests per second. That's awesome! Drupal 8 with caching completed the test in 23.63% less time on php7.0 compared to php5.6. And Drupal 8 caching handled 30.94% more requests per second.

Great news for Drupal 8 developers.

Drupal 8 is first and ready among several things for end users, marketers, and site managers to enjoy. For Drupal 8 developers, PHP 7’s performance boost of about 30-75% compared to PHP 5.6 makes a huge difference for us. Having Drupal 8 PHP 7 ready means we'll be going higher with our Drupal projects—much, much faster.

About the Author
Bhushan Nagaonkar, PHP/Drupal Engineer - L3
About the Author

Bhushan Nagaonkar, PHP/Drupal Engineer - L3

Our introverted philosopher (obsessed with "factoids") and cinephile—but not horror films, he hates those.


Leave us a comment

Back to Top