Back to Browse

New Features - Null safe Operator PHP 8

1 views
Dec 11, 2025
4:54

Null-safe operator has been added to PHP 8.1: it is a new object operator that prevents a Fatal error, and its following execution stop, when calling a method or a property on the null value. It has a high appeal, given that it is called ‘safe’ and it reduces the checks prior a method call. And the null safe operator in practice also has its own drawbacks. The first drawback is the check that was before the method call, should actually be after it: it is still needed. The second one is that the types used in the expression must now avoid

Download

0 formats

No download links available.

New Features - Null safe Operator PHP 8 | NatokHD