PHP 8.0 is a major update of the PHP scripting or development language which is used to develop web-based apps and websites.
The new update was released on November 26, 2020 and contains many new features which improve the performance and security of any apps or websites which use the PHP programming language.
Besides some major changes, in addition to speed, PHP 8.0 delivers new features such as the much anticipated JIT compiler, union types, attributes, and much more.
Some of the features included in the latest release are highlighted below.
Just-In-Time (JIT) Compiler
JIT was already available as a testing tool, but its performance and usability are much improved in the latest version of PHP. By design, JIT was available in disabled mode to experiment and evaluate the other variables in previous versions.
JIT will increase the speed of any applications using PHP 8.0 due to how it handles the compilation of the PHP scripts. It also opens the door for new areas where the PHP language can be used, for example, Artificial Intelligence.
Now officially a part of the PHP environment, the new and improved JIT compiler lets you execute the code within an application faster.
Attributes
Attributes, usually known as annotations in other development languages, provide a method for adding metadata to classes without having to parse docblocks, which is an area of text within the code that normally describes it's functions.
Consistent Type Errors
In PHP, user-defined functions throw TypeError, but internal functions do not. They produce warnings instead and return a null or empty value. The behaviour of internal functions has been made consistent throughout PHP 8.0
Numeric Strings & Comparisons
When using numbers or numeric values in items of data or strings, the PHP-type system attempts to do several smart things. This will make the behaviour more transparent and consistent, especially when making comparisons between different numeric strings and values.
Before making any upgrades to PHP 8.0, it is important to be aware of what are called Breaking Changes so that your website or application will run as normal.
Not knowing what the changes are will result in your website or application not running correctly so it is important to know which updates need to be made before upgrading.
If you are a customer with the Digital Chimps, we will manage this and any other upgrades for you but if you require help or would like to ask us a question, please contact us.
