Following up on WordPress in a Next Generation PHP World

In April, just as WordPress 4.3 was beginning development, I started a conversation about WordPress, PHP7, and HHVM. Now that WordPress 4.3 has been released, I’m glad to say WordPress is looking great as far as PHP7 goes.

I’m planning on spending some time during the 4.3 development cycle focused on these next generation platforms.

The PHP core team did a solid job of not introducing many breaking changes with this release, which really helped to make the transition easier. The two major changes that WordPress needed to make in order to have passing unit tests on PHP7 were to deprecate PHP4 style constructors and updating some variable variables.

Screenshot of Travis-CI showing WordPress tests passing on PHP7
The final commit of WordPress 4.3 has PHP7 tests passing and running faster then any of the other PHP versions.

In 4.4, I intend to continue to focus on PHP7.  The release schedule targets Mid October 2015. I hope to move PHP7 out of the Allowed Failures bucket on Travis-CI the day it is released.

Next up is getting the unit tests passing on HHVM. Onward!

WordPress in a next generation PHP world

My elephant tattoo

HHVM has now released it’s second long term support release and PHP 7 is in the final stages of implementing changes. It’s an exciting time for PHP and to be a PHP developer which means it is also an exciting time to be a WordPress developer since it creates an opportunity for WordPress to once again embrace forwards compatibility.

While I was at PHPUK, one of the most common conversations I had was people being critical of WordPress for supporting PHP 5.2 as a minimum.  Many of those same people became less critical once they find out WordPress runs great on PHP 5.6 and that many people run it on HHVM.

For the last several weeks, WordPress has been running it’s unit tests on PHP7 nightly builds. They’ve been running on HHVM for months. Right now, the unit tests are not passing for either one and as far as I know, have never passed for either one.  This is a problem.

I’m planning on spending some time during the 4.3 development cycle focused on these next generation platforms. Rasmus has put together a php7 vagrant box and JJJ created an addon to Varying Vagrant Vagrants to enable HHVM there. WP engine also has it’s own WordPress HHVM vagrant box. I intend to use all three of these to help.

Davey Shafik has put together a great two part series on the changes coming in PHP 7.  The two changes that are most likely to cause issues for WordPress sites are the removal of all deprecated features and the deprecation of PHP4 style constructors. This is going to affect many widgets along with all sorts of other code.

It’s exciting to see PHP moving forward.  The competition between HHVM and PHP runtimes is making PHP faster and is only going to push the language forward. It’s a great time to be writing PHP.