Using Stringable Interface in PHP 8.0

Using Stringable Interface in PHP 8.0

PHP supports magic methods that allows 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 a union types. A union type…
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…