0
Php

PHP – 8.0 Match Expression

In PHP 8.0 there is a new feature or I should say a new language construct (keyword) going to be introduced,  which has been implemented depending on the following RFC. This RFC proposes adding a new match expression that is similar to switch but with safer semantics and the ability to return values. Let’s see an example using switch : The same […]

0
Php

New Union Type in PHP – 8

A new RFC has been finished voting and accepted for PHP – 8. That is “Union Types”, which is an extension of PHP’s type system. A union type accepts values of multiple different types, rather than a single one. PHP already supports two special union types: Type or null, using the special ?Type syntax. array or Traversable, using the special iterable type. However, […]