Authentic.
  • Plans & Pricing (On Sale!)
  • Client Login
ChemiCloud Blog
  • Plans & Pricing (On Sale!)
  • Client Login

PHP 8 is Now Available at ChemiCloud

    Updated on
  • January 15, 2021
  • 5 minute read
  • By Michael Thomas
Total
0
Shares
0
0
0

PHP 8

PHP 8.0.1 may have been officially released on January 7th, 2021, but we decided to evaluate its integration with cPanel and our infrastructure to ensure it would be 100% compatible and our customers wouldn’t have any troubles. 

We are happy to announce that PHP 8 is now available to all ChemiCloud customers. 🎉

Let’s dive into some of the most exciting improvements and new features that will make PHP 8 faster and more reliable.

PHP JIT (Just in Time Compiler)

The new PHP JIT feature is something many, many developers have waited for and is the most acclaimed feature of the PHP update overall.  

The RFC proposal describes JIT as:

“PHP JIT is implemented as an almost independent part of OPcache. It may be enabled/disabled at PHP compile-time and at run-time. When enabled, the native code of PHP files is stored in an additional region of the OPcache shared memory and op_array→opcodes[].handler(s) keep pointers to the entry points of JIT-ed code.”

The JIT – or Just In Time – compiler promises huge performance increases over OPCache for CPU Heavy Applications. If you aren’t using any caching modules on your site, you’re missing out. And for those of you who are using caching, like OPCache, enabling JIT on apps that need a lot of CPU, like WordPress, Magento, and Drupal, should give you a significant performance increase. 

It’s important to keep in mind, JIT is still very new and bug fixes are still rolling out for it, so keep this in mind while using it. 

You can always find release notes on the latest changes and improvements to PHP here.

Other Major Improvements and New Features

  • Union Types – These extend type declarations (return types, parameters, and class properties) to declare more than one type. They also support false as a special type (for Boolean false), a trait that’s prevalent in legacy code that did not use Exceptions.
  • Named Parameters – This release now allows named parameters in function/method calls in addition to traditional positional parameters.  This makes the function/method parameter names part of PHP’s public API. 
  • Constructor Properties – A new syntax to declare these class properties right from the class constructor (_construct magic method). In this feature, PHP now supports declaring the visibility of these as public, private, or protected, as well as their type. 
  • Attributes – These allow for the declaration of meta-data for functions, classes, properties, and parameters. 
  •  match expressions – These are similar to switch blocks, but match blocks provide type-safe comparisons, support a return value, and don’t require break statements to break-out, and they also support multiple matching values. 
  • Null safe operator – This provides safety in method/property chaining when the return value or property can be or needs to be null. 
  • WeakMaps – this allows you to store and associate arbitrary values for object keys, without preventing the garbage collector from clearing it if the object falls out of scope somewhere else. 

Deprecated Features in PHP 8

We always like to mention deprecated features so our readers are aware and can update their code accordingly: 

  • PostgreSQL: Several aliased functions are deprecated
  • Deprecate required parameters after optional parameters in function/method signatures
    `ReflectionParameter::getClass())`, `::isArray()`, and `::isCallable()` methods deprecated
  • Disabled functions: Reflection and `get_defined_functions()` deprecations
  • `libxml_disable_entity_loader` function is deprecated

For a complete list of improvements, new features, and deprecations, be sure to review the PHP.net official documentation and change log here. 

How to Switch PHP Version to PHP 8 in cPanel

PHP 8  is available for all ChemiCloud customers. Before doing the switch to PHP 8 we strongly recommend you to check the compatibility of your website’s code with the new PHP version. Some web apps, themes, or plugins may not be fully compatible with PHP 8 yet.

You can easily update your PHP version to 7.4, from cPanel, using the PHP Selector by following the steps described below:

1) Log in to your cPanel account.

2) Navigate to the Software section and click on Select PHP Version.

Select PHP Version

3) Click on the PHP Version drop-down box and select PHP 8 version:

 

Important Note Re: WordPress 5.6 & PHP 8

WordPress version 5.6 (the latest release) officially supports PHP 7.4. Using PHP 8 with WordPress should be done with caution and it is not recommended at this time to run PHP 8 with your production site. 

While WordPress will run on older versions of PHP, like version 7.2, it is not recommended as PHP 7.2 reached EOL or End Of Life on November 30, 2020, which means it is not receiving any security updates, and using it will expose your site to possible security vulnerabilities. 

PHP version 7.4 will reach the end of life on November 8, 2022, which gives WordPress roughly 2 years to bring it up to date with the new standards introduced in PHP 8. The updates to WordPress should come well before that time, however, knowing how swift the WordPress teams work. 

WordPress has stated that it’s latest release, Simone version 5.6, is beta compatible with PHP 8, but you should use it with caution as it is still possible undiscovered incompatibilities may exist. To quote the WordPress team: 

“WordPress Core aims to be compatible with PHP 8.0 in the 5.6 release (currently scheduled for December 8, 2020).

…Significant effort has been put towards making WordPress 5.6 compatible with PHP 8 on its own, but it is very likely that there are still undiscovered issues remaining.”

Additionally, themes and plugins may not yet be compatible with PHP 8, and using it could introduce further complications with your websites. There are many old PHP functions from PHP version 7.4 and earlier which were removed in PHP 8, which means that themes and plugins which use those functions will break in PHP 8. 

Conclusion

In this post, we covered some of the new features that we can expect with the release of the PHP 8 version. If you’re looking for the full list of features, updates, and deprecations along with the official documentation, check out the following resources:

  • PHP 8 Requests for Comments
  • PHP 8 Upgrade Notes
  • PHP 8 Preparation Tasks

If you’re a ChemiCloud client, you can already update to the latest PHP version using the PHP Selector in your cPanel. 

Additionally, if you are using WordPress, consider waiting until WordPress releases a version stated to be fully compatible with PHP 8 before upgrading your PHP version. 

Questions? Comments? Leave a note below! 

 

You May Also Like
Personal Information
View Post

Personal Information and Why Protecting It Matters in the Digital Age

    Updated on
  • December 6, 2022
  • By Bogdan Tirpescu
View Post

Shared Hosting vs WordPress Hosting: What’s the Difference?

    Updated on
  • November 9, 2021
  • By Bogdan Tirpescu
Become a Domain Reseller
View Post

How to Easily Start Your Domain Reselling Business

    Updated on
  • January 17, 2022
  • By Michael Thomas
Shared Hosting
View Post

What Is Shared Hosting? Explained for Beginners

    Updated on
  • October 15, 2021
  • By Michael Thomas
View Post

What Is Web Hosting? A Beginner’s Guide to Website Hosting

    Updated on
  • October 6, 2021
  • By Michael Thomas
View Post

7 Ways to Stop Spam Emails From Reaching Your Inbox

    Updated on
  • September 17, 2021
  • By Michael Thomas
Google PageSpeed Insights
View Post

Everything You Wanted To Know About Google PageSpeed Insights Tool

    Updated on
  • September 2, 2021
  • By Michael Thomas
Guest Mode
View Post

A Deep Dive into Guest Mode for LiteSpeed Cache

    Updated on
  • September 2, 2021
  • By Michael Thomas

Leave a Reply Cancel reply

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

Recent Posts
  • Personal Information
    Personal Information and Why Protecting It Matters in the Digital Age
      Updated on
    • December 6, 2022
    • 8 minute read
  • Shared Hosting vs WordPress Hosting: What’s the Difference?
      Updated on
    • November 9, 2021
    • 6 minute read
  • Become a Domain Reseller
    How to Easily Start Your Domain Reselling Business
      Updated on
    • January 17, 2022
    • 7 minute read
  • Shared Hosting
    What Is Shared Hosting? Explained for Beginners
      Updated on
    • October 15, 2021
    • 8 minute read

Subscribe now to our newsletter

  • Shared Hosting
  • WordPress Hosting
  • Reseller Hosting
  • VPS Hosting
© 2020 CCHOSTING, INC. ALL RIGHTS RESERVED

Input your search keywords and press Enter.