Hi Ilija,


I'd like to introduce another RFC I've been working on:
https://wiki.php.net/rfc/nullsafe_operator

It introduces the nullsafe operator ?-> that skips null values when
calling functions and fetching properties. In contrast to the last few
attempts this RFC includes full short circuiting.

Would this still work together with short-circuiting and the null coalesce operator?

I just didn't see a clear example about this but also figured that could be a practical way to use this:

```php
$country = $session?->user?->getAddress()?->country ?? 'defaultCountry';
```

(hope the example is readable, my MUA insists on wrapping the lines)

thanks,
- Markus

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to