PHP 7.1 Now Available on All Hosting Plans!

We’re happy to announce we now officially support PHP 7.1 on all our shared, reseller and semi-dedicated hosting services.  PHP 7.1 is the first point release in the 7.x series and it comes with many outstanding improvements and new features.

To enable PHP 7.1 all you need to do is login to cPanel go to ‘Select PHP Version’:

select_php_version

From here just pick PHP 7.1 from the drop down and set it as your current PHP version.  After this you’ll be able to manage extensions as you would for any PHP version we offer and your entire account will use PHP 7.1.

If you were curious about some of the new features and improvements here’s a quick overview of them:

Nullable Types

In PHP 7.0 there was an introduction of types but it had one limitation you could not declare a parameter to be null without also making it optional.  This has been resolved by utilizing the ? character. For example:

function myFunction(?int $variable)
{
    var_dump($variable);
}

myFunction(100);
myFunction(null);

This code would return int(100) for the first and NULL for the second call to the function.

You can also use nullable types for a return type for example:

function myFunction(?int $number): ?int
{
    if ($number == null)
    {
        return null;
    }
    return $number * $number;
}

Void Return Type

You can now specify that a function cannot return a value. For example:

function voidReturn(): void
{
    return 5;
}

This would now return that a void function must not return a value.

If your website software/application supports PHP 7.1 we suggest giving it a try. Our PHP Selector makes it easy to switch between PHP versions so you can revert back to an older version at any time. We hope you all find this to be a useful release!

This entry was posted in General and tagged , , . Bookmark the permalink.

2 Responses to PHP 7.1 Now Available on All Hosting Plans!

  1. Web Hosting Jobs says:

    Always good to update PHP. Glad to see HawkHost keeping updated and it’s nice that cPanel offers you the ability to switch PHP versions.

  2. Web Hosting Malaysia says:

    Most the best reseller hosting service ever with hawhost hosting.
    All my client happy to hear it.

Leave a Reply

Your email address will not be published. Required fields are marked *