The main version of PHP 7.0 was released a year ago. It laid the foundations for future PHP development (PHPNG) by adding outstanding features, enhanced performance, high speed and reduced memory usage.
A few days ago PHP 7.1 was released. This is the first version from the PHP 7.x series as it contains many improvements and new features, but also a few incompatibilities with older versions.
What’s new in PHP 7.1?
Here are some of the most remarkable improvements and features:
- Nullable types; (additional option for parameters or function returns to be of NULL);
- Void return type (declares that this function doesn’t return any value, including ‘NULL’);
- Iterable pseudo-type;
- Class constant visibility modifiers – make class-constants (such as private, protected, public) visible;
- Square bracket syntax for list() – is a new syntax for list() (with [] syntax);
- improved method for catching exceptions (Catching Multiple Exception Types);
- Deprecated features:
- Mcrypt;
- The eval option for mb_ereg_replace () and mb_eregi_replace();
- and many more.
Activating PHP 7.1
If you are using the shared hosting or Managed VPS, you can enable PHP 7.1 in cPanel -> PHP Manager by SuperHosting.
You can also enable a different PHP version for a specific directory by modifying the .htaccess file.
Customers using VPS, Cloud VPS or dedicated server may install PHP 7.1 manually.
For the time being Joomla! and Drupal have not yet officially announced if they will support the new PHP version. This will probably happen when their next versions are released. WordPress 4.6 is not PHP 7.1 compatible but the new 4.7 version is fully compatible.
Before switching to 7.1 you would better make sure that your website along with the theme and plugins used can properly work with the latest PHP version. If you have already enabled 7.1 and notice that а certain functionality does not work, you can always downgrade to an older PHP version from PHP Manager by SuperHosting that is available in your cPanel.