PHP 7.3 is now available on all ICDSoft hosting servers. It is enabled by default for all new hosting accounts. If you are an existing customer, you can easily switch to the new version via the PHP Settings -> Default PHP Interpreter section in the online Control Panel. With the addition of PHP 7.3, the total number of supported PHP versions on our servers is now five. Currently, we support the following versions:

  •  PHP 7.3
  •  PHP 7.2
  •  PHP 7.1
  •  PHP 5.6
  •  PHP 5.3

Table of Contents

Change the PHP version of your hosting account

Changing PHP versions with ICDSoft’s hosting plans is very easy. Click the image below to see a video on how to perform the change:

We switched our own WordPress blog to PHP 7.3, and the execution time of the index.php script got 6% shorter than with PHP 7.2. For sites that are still running on PHP 5.6, the performance boost is even bigger (the script execution time could be cut in half).

PHP 7.3 release date

PHP 7.3 was released in December 2018. The release announcement can be found here: https://www.php.net/releases/7_3_0.php

We considered adding it back then, but our experience shows that new PHP versions need some time to be adopted by the software community. WordPress core was fast to jump on the wagon, and PHP 7.3 has been listed as a recommended hosting platform for a few months already but, unfortunately, many plugins and themes weren’t fully compatible with this version. If you are a developer of a WordPress plugin, or theme, you can check the following informational article on WordPress.org on PHP 7.3 compatibility:

If you are using a theme/plugin that isn’t fully compatible with PHP 7.3, you could send this article to the theme/plugin developer.

PHP 7.3 changes

While not a major upgrade like PHP 7.0, or even 7.2, PHP 7.3 comes with its set of deprecations and breaking changes. Here are the most important ones:

Heredoc and Nowdoc changes

These are perhaps the most significant changes in PHP 7.3 – the way it handles heredoc and nowdoc has been improved and now provides additional flexibility.

Heredoc closing marker indentation

Before PHP 7.3

<?php
class foo {
    public $bar = <<<EOT
bar
EOT;
}

PHP 7.3

<?php
class foo {
    public $bar = <<<EOT
        bar
    EOT;
}

In short, in PHP 7.3 you can now indent the closing marker (EOT;) and this sets the amount of whitespace that needs to be trimmed. Before PHP 7.3 indentation wasn’t allowed and the new code would generate errors. You can check https://wiki.php.net/rfc/flexible_heredoc_nowdoc_syntaxes for more information and examples.

Trailing marker new line removal

Before PHP 7.3 you were required to add a new line right after the closing marker. This requirement has now been removed. Here are two code examples to make this clearer:

Before PHP 7.3

<?php
stringManipulator(<<<END
   a
  b
 c
END
);
 
$values = [<<<END
a
b
c
END
, 'd e f'];

After PHP 7.3

<?php
stringManipulator(<<<END
   a
  b
 c
END);
 
$values = [<<<END
a
b
c
END, 'd e f'];

Backwards compatibility impact

Small. The more flexible format now technically allows more collisions.

Previous code will now throw errors if (and only if) the following conditions are met:

  • the colliding marker begins at the start of a line in the text
  • the colliding marker can be seen as a standalone, valid symbol name

Trailing coma in function calls

is now allowed. This is mainly a code style improvement for those that are accustomed to adding a comma after every declaration. Here are some sample code snippets illustrating this change:

Before PHP 7.3

<?php
foo(
    $foo,
    $bar
);

After PHP 7.3

<?php
foo(
$foo,
$bar,
);

Backwards compatibility impact

None. No existing code will be affected by this change.

Deprecation and removal of case-Insensitive constants

Before PHP 7.3, you could declare case-insensitive constants by passing “TRUE” as the third parameter of define():

define('Foo', 'Bar', true);

This piece of code will throw the following error in PHP 7.3:

Deprecated: Case-insensitive constants are deprecated. The correct casing for this constant is "Foo"

Backwards compatibility impact

Moderate. Existing code will need to be scanned and case-insensitive constants will need to be replaced. Since case-insensitive constants were an optional feature, it is likely that not many projects will be affected.

PCRE upgrade

The Perl-Compatible Regular Expressions (PCRE) extension has now been upgraded to PCRE2. PCRE2 is claimed to be backwards compatible with the old version, but there are some minor changes. PCRE2 has stricter validation of patterns, which means that some existing pattern matches may not compile now.

Backwards compatibility impact

Moderate. Because of the more strict validation, some existing code may stop working. The debugging process may be detrimented, as you will not get an error – the regular expression may simply stop matching. Check the PHP Wiki for more information on the PCRE2 migration – https://wiki.php.net/rfc/pcre2-migration.

Other changes

The full list of changes is available at PHP’s website. Here is a link to the most important changes – Backwards Incompatible Changes PHP 7.3.

Author