Research Documentation Php8

Research Documentation Php8

5R - PHP 8

PHP New Version - Feature 1

One new feature of the latest PHP version is that PHP 8.2 added supports for declaring a type by combining Union Types and Intersection Types.

PHP New Version - Feature 2

Another feature added into the latest version of PHP are new "readonly" classes. If you decalre a class as radonly, all it's properties will automatically inherit the readonly feature. Declaring a class readonly is the same as declaring every class property as readonly.

PHP New Version - Feature 3

Another feature added into the latest version of PHP is you can now allow true, false, and null as standalone types. If you tried declaring false or null without them being part of a union type, it resulted in an error. With this new addition that PHP added, you can now declare the return, parameter, and property types.

Summary

In summary, the latest version of PHP 8.2 has quite an improvement from the previous versions.