An Introduction To PHP 7 For WordPress Users

1 year ago
200 Views

WordPress has played a hugely significant role in helping PHP conquer the web over the last 12 years. While WordPress has whizzed through successive versions at an ever-increasing rate during that time, the language that still powers the majority of the platform has remained incredibly stable behind the scenes.

Big changes are finally in the offing with the arrival of PHP 7, however, and major WordPress hosts such as WP Engine are already kicking the tires of the latest release and getting ready to fully support it for their users.

In this piece, we’ll take a look at the development of PHP 7 to date, what the major changes are, what they mean for WordPress users, and consider whether you should be thinking of making the switch to the new version straight out of the gate.

Let’s tee things up with a brief trip down memory lane.

How PHP Took Over the Web

PHP’s current omnipresence is almost taken for granted these days, but there was very little to suggest that it would go on to dominate the web when it was first cobbled together by Rasmus Lerdorf back in 1994.

In many ways, PHP’s rise to the top has been a triumph of good, old-fashioned elbow grease over abstract programmatic concerns. In contrast to competing solutions such as Java and Perl, the language was straightforward enough to attract an audience new to the web, and simple enough on the server side to quickly become a standard install option at hosts worldwide. Put simply, PHP enabled a generation of coders to just get it done.

Its early adoption by a host of popular CMS offerings sealed the deal, with WordPress being by far the most significant of them. The PHP 5.x series sprang into life in 2004, and if you’re running WordPress today, you’re almost certainly running a minor version of this under the hood as we speak.

The 5.x series has served PHP well over time, but 12 years is a long time between major versions. Sooner or later, a change was bound to come.

PHP 7 Finally Heaves Into View

Before we get into the nitty-gritty of PHP 7, let’s get some potential naming confusion out of the way. The last stable release of PHP was PHP 5.6 in 2014, so at this stage, you might well be wondering what happened to PHP 6.

To cut a long story short, there was a previous attempt at a new major version using the name PHP 6 from 2005 to 2010 that never fully got off the ground, and to avoid muddying the waters, the decision was eventually made to go straight from the 5.x series to PHP 7.

PHP 7 has been under active development since 2014, and was officially released in December 2015. Its development arrived at an interesting time in the wider PHP world, as new initiatives such as Facebook’s HipHop Virtual Machine were simultaneously expanding what was previously thought possible with the language.

Add in the fact that it’s been over a decade since the last major release, and there was understandably a lot of excitement and anticipation leading up to PHP 7 actually landing – and land it duly did!

Let’s step through the main points that have been setting developers’ pulses racing since then:

  • It’s a true major release. A major release is effectively a clean slate, and clears the decks for major (potentially breaking) changes. With the amount of cruft that PHP has gathered over the years, this is excellent news for all concerned.
  • There’s a brand new engine under the hood. The Zend Engine II has been doing sterling work on the PHP 5.x series over the years, but PHP 7 will be firing on all cylinders thanks to the spanking new PHPNG (Next Generation) engine that powers it.
  • A host of powerful new language features are available. The latest version of PHP 7 ships with plenty of new options for developers to explore, including type declarations, space ship operators, and significantly improved error handling. Check out Treehouse’s excellent run-down of the main items for an in-depth overview of the main significant points.

The main appeal of the new version (and the thing that will be of most interest to the average WordPress user) can be summed in one word – speed. Let’s move on to look at it in a bit more depth.

Comments

Leave a Comment

Your email address will not be published. Required fields are marked *

2 × 2 =

Menu Title