NR Hosting team are so excited to announce that our Cloud Hosting platform now supports PHP 7, the latest release from the PHP team. PHP 7 comes loaded with new features and under the hood improvements that give web developers the ability to create cleaner, faster and more efficient code.
But where’s PHP 6?
First things first – where’s PHP 6? PHP 6 was originally planned and being developed, due to the time taken to implement some of the bigger changes at the very core of the language, new features planned for version 6 were instead added to releases in version 5. Eventually it was decided that, since most of the features planned for 6 had now been added to the language, that they’d jump straight to version 7 instead.
New PHP 7 Features
PHP 7 has a lot of new features that we can’t cover in depth you can check it here [ PHP7 Feature ] but, I’ve pulled out some of the more exciting new features:
Improved performance: As part of the update, large parts of the PHP interpreter have been rewritten to improve the speed at which PHP executes code. This is achieved by reducing the number of CPU cycles required. The changes have resulted in improvements on real world tests from anywhere between 25% all the way up to 70%. All this without changing a single line of code of the applications.
Scalar and return type declarations: It is now possible to explicitly specify what sort data types a custom function will accept and return. You can also set the strictness of these declarations which will tell PHP whether to try and convert data types or throw exceptions.
Null coalesce operator: An improvement on the existing ternary operator which allows you to directly compare whether the item you’re checking. Previously if you wanted to see if a variable was set and take action accordingly you’d need to combine the ? operator with the isset function. The new ?? operator lets you do this without needing to call another function.
Filter unserialized data: The unserialize function, used to take serialized arrays and convert them back into standard arrays, now has the ability to apply filters to the data being converted. This means it is now easier to handle the unserializing of data, especially from untrusted sources, in a much safer way and reduce the risk of code injection.
Whilst PHP 7 makes a lot of changes, it is largely designed to be backwards compatible. Therfore it should be possible to upgrade without any issues however, we highly recommend that you check the compatibility of your scripts before making the upgrade.
Using PHP 7 on your Cloud account
Our Cloud Hosting allows you to run different PHP version on a per site basis. You can update your site to use PHP 7 from your control panel in just a few clicks. To change your PHP version between 5.2, 5.3, 5.4, 5.5, 5.6 and PHP 7 follow these steps:
Step 1. Log in to your control panel.
Step 2. Ensure you are managing the website you would like to update. Locate the ‘Advance Management Tools’ section and click the ‘PHP Version’ icon.
Step 3. Expand the drop down menu, select the PHP version you would like to run and click ‘Set’ .
Please note: Older script or apps may be not comfortable with PHP 7 . Make sure you are using the latest version which is suitable with PHP 7. You can use latest WP 4.4 with PHP 7