New features of php8

Time:2021-5-9

Detailed description and code are on GitHub, welcomestarandfork

Brief description of php8.0.0

  1. PHP 8.0.0 alpha 1 will be released on June 25, 2020, and GA 8.0.0 will be released on November 26, 2020. Click view.
  2. PHP 8.0.0 alpha 1 cannot be used in production environments. Click to view the details
  3. PHP 8.0.0 alpha 1 download address

Some new features of php8.0.0

All new features visible:rfc

1. Cascade priority

New features of php8
stayPHP7.*Results in
New features of php8
Results in php8.0.0
New features of php8

2. Type of Association

(1) The union type of the parameter
New features of php8
result:
New features of php8
(2) The union type of the return value
New features of php8
result:
New features of php8
(3) The union type of parameters and return values
New features of php8
result:
New features of php8

3. str_ Contains function

New features of php8
result:
New features of php8

4. Fdiv function

New features of php8
result:
New features of php8

5. get_ debug_ Type function

New features of php8
result:
New features of php8

6. ::class

New features of php8
result:
New features of php8

7. error_reporting

PHP 8.0.0 php.ini-developmentandphp.ini-productionThe default error level is:E_ALL
New features of php8
New features of php8

8. Attributes

There are several ways to write annotations in php8

1. <<Name>>
2. <<Name(Arguments)>>
3. <<Name(Argument1, Argument2, ......)>>

New features of php8
result:
New features of php8