New Features of PHP8

Union Types

Simply put, union types are a collection of 2 or more different data types. Please note that 'void' cannot be a part of a union as it cannot return a value.

Named Arguments

Named arguments allow one to call methods or functions with a huge amount of arugments thus, avoiding confusion.

New 'static' Return Type

This feature allows one to narrow down the return type to the called class.

Summary

To effectively develop moderen websites, developers are continually striving to find faster and more effective ways to code. New and updated features help exponentially in achieving this.