New mixed Type in PHP 8.0

New mixed Type in PHP 8.0

PHP supports type declarations that can be used for parameters, return values, and properties. However, there may be situations when we need a type that is not supported by PHP...
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...