Categories
WordPress

This might be the first post ever published on WordPress using PHP7.4.

I have every reason to believe that this is the first post ever published on WordPress using PHP7.4. It’s likely coming a bit premature, but if you aren’t willing to have some fun, then why maintain upstream language compatibility of an open source project. I’ve worked on php version support in WordPress since PHP7.0 and made the first post using WordPress on php7.3, so this is becoming a fun tradition.

Yesterday I added code to WordPress core to fix a number of deprecations in PHP7.4. PHP7.4 is scheduled to be released on November 28, which is 74 days and 5 release candidates away. The goal for WordPress is that version 5.3 will fully support PHP7.4 and that version is scheduled to be released 12 November 2019.

The biggest deprecations in 7.4 that affect WordPress core are around magic quotes and

For plugin and theme authors, you’ll want to look into:

PHP7.4 features for WordPress Developers

It’s not just deprecations in PHP7.4 that WordPress developers can look forward to, but the PHP internals team has added some new features for us to use as well.

Typed Properties continue the evolution of PHP’s type system to allow for class properties to be type strict. The only Property types you can’t use are void and callable, otherwise every type decleration is supported.

Arrow Functions allow for simpler anonymous functions. I recommend only using these in callbacks such as with array_map in order to make your debugging simpler.

Coalescing Assignment is here as syntactical sugar. ??= allows for you to add default values easier.

If you see any errors or notices on this site, let me know in the comments. Assuming this actually publishes, then WordPress can be used with PHP7.4, but I only recommend it for those feeling especially adventurous.

Categories
Art Design Four Short Things Programming

Four Short Things – 9 February 2019

Inspired by O’reilly’s Four Short Links, here are some of the things I’ve seen, read, or watched recently.

The Value of Good Design

MoMA’s spring exhibition includes a show featuring everyday objects, the types that it’s feasible to find in our homes. Brooms, Rakes, Chairs, A Slinky. With an emphasis on work that appeared in shows from the 1930’s to 1950’s, there is plenty of Eames, Saarinen, and Bruan to make any home goods nerd geek out. In addition to the main section of the show, there is a small lab where you can couch and sit on some of the items on display. It’s open until June 15.

Terraform

Describing itself as “Write, Plan, and Create Infrastructure as Code”, terraform allows for almost every part of your infrastructure to happen as code. You can thus keep your DNS in GitHub. You can keep your GitHub config in GitHub too.

What’s new in PHP7.4?

Odds are, you aren’t running PHP7.3 yet, but that doesn’t mean work hasn’t started on PHP7.3. Heck, 8.0 is already being planned. It’s still early, but coalesce assignment is my prediction for what is going to cause the most useless arguments and also be the biggest win.

Inclusive Design: Who’s Opportunity is it?

My friend David uses his journey to help explain how inclusive design is a win for everyone. He looks at Inclusive design as an opportunity for business, content, quality, performance, and people. Definitely was one of the best things I read this week.

Four Short Things is a series where I post a small collection of links to art, news, articles, videos and other things that are me. Follow my RSS feed to see Four Short Things whenver it comes out.

Categories
Uncategorized WordPress

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.

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!

Categories
Code Uncategorized WordPress

WordPress in a next generation PHP world

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.