WordPress 4.4 + PHP 7 + SSD = great performance

Posted in WordPress by

WordPress 4.4

WordPress 4.4 has been released! You can now find WordPress 4.4, named “Clifford”, in our one-click installer. It’s running recently-introduced PHP 7.0.

WordPress 4.4 has several new features, including:

  • a new default theme, Twenty Sixteen, that’s designed to look sharp on all screens, from mobile phones to giant desktop displays
  • responsive images so WordPress shows images at the right size for each device (potentially abbreviating page loads)
  • embeddable WordPress content, so your content can be shared more gracefully across sites that support consuming oEmbed data
  • more support for embedding outside content, like Speaker Deck and Reddit comments

Plus, many changes have been introduced to WordPress core to support WordPress developers—including changes that lay the groundwork for the eventual introduction of a REST API in WordPress core in a future release.

Specific to WebFaction, installations of WordPress 4.4 use PHP 7.0. PHP 7.0 is known to improve the performance of many PHP applications. In an informal test of a new WordPress 4.4 installation running under FastCGI, PHP 7.0 handled almost a third more requests per second than PHP 5.6:A graph comparing WordPress 4.4 under PHP 5.6 and PHP 7.0

And that’s before any other steps to optimize the application, like caching WordPress.

For a complete look at the changes in WordPress 4.4, check out the project’s official announcement. When you’re ready, fire up a WordPress 4.4 installation with the one-click installer. If you have any questions, join us in the Q&A community.

-
-

PHP 7 is here!

Posted in PHP by

PHP 7 is here

PHP 7 has been released! That’s right, PHP 5.6 has given way to PHP 7.0 (stop, do not pass PHP 6, do not collect $200)! The new version is now available on all WebFaction servers. So let’s take a look at some of the biggest changes in PHP 7.

Performance

Perhaps the most talked about part of PHP 7 is the substantial improvement in performance and memory usage. Measuring requests per second, benchmarks with PHP 7 have shown 30 to over 100 percent improvements over PHP 5.6. You read that correctly: upgrading to PHP 7 can sometimes double the performance of an application. The PHP project achieved these gains by merging the changes of PHPNG into the main PHP project. Although memory benchmarks are harder to come by, anecdotal reports are that PHP 7 uses less memory as well. While the real-world performance gains of upgrading to PHP 7 vary by application, you should expect to experience a marked improvement.

Spaceships

PHP 7 comes with a spaceship, or at least it comes with an operator that looks like a spaceship: <=>. The spaceship operator, more formally known as the “combined comparison” operator or “three-way comparison” operator, makes it easier to write comparisons for sorting. The spaceship operator compares two values and evaluates to 1, -1, or 0, if the first value is greater, less than, or equal to the second value, respectively.

Take the expression a <=> b, for example. If a is greater than b, then the expression evaluates to 1. But if a is less than b, then the expression evaluates to -1. If a and b are equal, the expression evaluates to 0. In this way, the spaceship operator reduces a complex ternary expression like ($a < $b) ? -1 : (($a > $b) ? 1 : 0) to just a <=> b.

Plus spaceships are cool. Pew pew!

Type hints

PHP 7 expands the language’s type hinting features. Previous versions of PHP supported limited argument type hinting. PHP 7 adds scalar type hinting to arguments, so you can hint int, float, string and bool for argument types. What’s more, PHP 7 lets you declare what type a function is expected to return, including the scalar types.

But there’s a catch

With these changes, you may be eager to upgrade, but keep in mind that PHP 7 is not a drop-in replacement for PHP 5.6. Many long-deprecated SAPIs and functions have been removed. There have been changes to errors and exceptions, variable handling, and source parsing too numerous to list here.

We recommend that you read the official guide on Migrating from PHP 5.6.x to PHP 7.0.x or see the the official ChangeLog to learn about every change and how it may affect your application. We also recommend that you test your application before upgrading your live site.

When you are ready to upgrade, you’ll find PHP 7 available in our one-click installer and on the command line as php70.

-
-