What’s New in PHP 7.3?
Does your current website use PHP? If it does, you might be wondering about the latest update. PHP 7.0 was developed in 2014-2015, but there have been several updates to it already. The latest, PHP 7.3, was released in December of 2018.
As a first class hosting company, we know how important it is to provide our valued clients with the flexibility they need. That’s one reason that Localnode combines first class hosting with superior software like CloudLinux, so our hosting clients can choose the version of PHP they want to use.
With that in mind, let’s review the most important changes in PHP 7.3.
#1: Improved Performance Speed
It’s common for software updates to include improvements in speed and performance. One of the most impressive changes with PHP 7.3 is that it is 10% faster than PHP 7.2 and 31% faster than PHP 7.0.
That number is even more exciting when you consider that PHP 7.0 was twice as fast as PHP 5.6. Even if you’ve been updating regularly, you can expect a dramatic improvement in the performance speed of your site when you upgrade to PHP 7.3 on a superior network with first class hosting.
If you pay any attention at all to user experience statistics, you know that the speed of your website plays a huge role in lead generation and a positive user experience. A site that’s slow to load will almost certainly have a higher bounce rate and a lower conversion rate than one that’s fast to load.
It may interest you to know that when Mozilla, the maker of the Firefox web browser, decreased the loading time of its landing page by just 2.2 seconds, they saw a subsequent 15.4% increase in Firefox downloads. That’s nothing to sneeze at.
On a related note, the improvement in speed also applies to programming. That means that if there are updates you need on your site your programmer will be able to complete them quickly and efficiently. That’s a big plus.
#2: Syntax Improvements
Some programmers have resisted using the existing heredoc and nowdoc syntaxes, which are used to define strings within PHP. The PHP 7.3 update brings improvements to both and should make them more appealing to web developers.
The issue previously was that the ending identifier needed to be the first string appearing on a new line. With the update, two things changed:
- The closing marker is enabled for indenting; and
- The new line requirement is removed after the closing marker
That’s a change that makes coding with PHP 7.3 both easier and more aesthetically pleasing. It’s particularly useful when using heredoc in a nested context because it neatens up the code and gets rid of the “ugly” appearance that caused some programmers to ignore heredoc and nowdoc in the past.
#3: Trailing Comma in Function Cells
It’s common for web programmers to use trailing commas in lists of coding elements, parameters, and properties. They improve the appearance of code, making it easy to read and edit. Earlier versions of PHP allowed trailing commas in arrays, but the 7.3 update brought some improvements.
With the 7.3 update, developers can add trailing commas in function declarations and grouped namespaces, a change that affects only function cells themselves. There are no changes to function declaration syntax with this latest update.
#4: Argon 2 Password Hash Improvements
There are three types of Argon2 password hashes available:
- Argon2i is optimised for password-based key derivation and password hashing and uses data-independent memory access
- Argon2d is faster than Argon 2i and utilises data-depending memory access
- Argon2id is a hybrid of the two and uses a combination of data-depending and data-independent memory access.
The PHP 7.3 update recommends Argon2id as the proper variant to be used in password_* functions. The password_verify() function will work with both Argon2i and Argon2id.
#5: Updates to FPM
Another important update with PHP 7.3 is an update to the FastCGI process manager which includes new options for customising FPM logging, as follows:
- log_buffering allows for experimental logging without extra buffering
- log_limit allows you to set the allowed length for log messages (up to 1024 characters) without wrapping
- decorate_workers_output is a pool option that lets you disable the output decoration for workers’ output when you enable catch_workers_output
These are all changes that make web development with PHP 7.3 more versatile than with older versions of PHP, especially when combined with first class hosting.
#6: Deprecation and Removal of Case-Insensitive Constants
Previous versions of PHP allowed for the use of both case-sensitive and case-insensitive constants, but case-insensitive constants can create unwanted bit complexities when they’re used. PHP 7.3 deprecates case-insensitive constants.
The two specific changes are:
- PHP 7.3 deprecates calling define() with third parameter true; and
- PHP 7.3 deprecates accessing a case-insensitive constant with a casing that differs from the declaration-site. It exempts the constants true, false, and null.
This Is another change designed to make PHP 7.3 more attractive to web developers.
There are a few other minor changes to PHP 7.3, including same site cookie flags and improvements to Windows file deletion. You can find a complete list of announced changes on the PHP website, here.
PHP 7.3 works best with superior hardware. To learn more about Localnode’s first class hosting services, which allow you to choose which version of PHP to use on your site, please click here now.