php 8 released

Support for PHP 8 on hosting

On November 26, 2020, PHP 8 was released. This version of PHP is already available for selection and use on our hosting site.
The main innovations in this version:

  • Named arguments – Specify only necessary parameters, skip the optional ones.
  • Attributes – Instead of PHPDoc annotations you can use structural metadata with native PHP syntax.
  • Declaring properties in the constructor – Less boilerplate code to define and initialize properties.
  • Union types – Instead of using PHPDoc annotations for union types, you can use union type declarations that are checked at runtime.
  • Match Expression – The new match expression is similar to the switch operator, but with special features
  • Nullsafe operator – Instead of checking for null you can use a sequence of calls with the new Nullsafe operator.
  • Improved string and number comparison – PHP 8 uses number comparison when comparing with a number string. Otherwise, the number is converted to a string and a string comparison is used.
  • Type consistency errors for built-in functions – Most internal functions now throw an Error exception if an error occurs during parameter checking.

Similar Posts