Using Stringable Interface in PHP 8.0

Using Stringable Interface in PHP 8.0

PHP supports magic methods that allow to perform various operations with objects. These methods names starts with two underscores (__). One of these methods is __toString magic method which allows...
Union Types in PHP 8.0

Union Types in PHP 8.0

In versions prior to PHP 8.0, we can specify a single type for parameters, return values, and properties. Since PHP 8.0, we can use union types. A union type allows...
Named Arguments in PHP 8.0

Named Arguments in PHP 8.0

PHP supports positional arguments. It means that we need to pass these arguments to a function or method based on the parameter position. The order of these arguments are important...