Den 2020-07-14 kl. 10:51, skrev Ilija Tovilo:
Hi Markus
https://wiki.php.net/rfc/nullsafe_operator
Would this still work together with short-circuiting and the null
coalesce operator?
$country = $session?->user?->getAddress()?->country ?? 'defaultCountry';
Yes, your example will still work,
Hi,
On 14.07.20 10:51, Ilija Tovilo wrote:
Would this still work together with short-circuiting and the null
coalesce operator?
$country = $session?->user?->getAddress()?->country ?? 'defaultCountry';
Yes, your example will still work, this is solely about references :)
Thanks for clarifyin
Hi Markus
> > https://wiki.php.net/rfc/nullsafe_operator
>
> Would this still work together with short-circuiting and the null
> coalesce operator?
>
> $country = $session?->user?->getAddress()?->country ?? 'defaultCountry';
Yes, your example will still work, this is solely about references :)
I
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 circuiti
Hi Peter
> Wouldn't it make more sense to make `isset` smarter? So that it can
> handle these situations just like it would with array access. That
> way you could use the null coalescing operator as well.
Both of those are valid approaches. I do prefer the ?-> operator for
two reasons.
1. ??
Hi Nikita
>> I'd like to introduce another RFC I've been working on:
>> https://wiki.php.net/rfc/nullsafe_operator
>
> The semantics look reasonable to me, but I'd recommend including some
> discussion on the rationale behind the short-circuiting behavior in the
> RFC. That is, what the options ar
BIG THUMBS UP for this feature.
As was mentioned that TypeScript uses this and saves developers lots of
time by avoiding nested null checking.
I suggest in the RFC including a list of other languages that have this
feature.
On Tue, Jun 2, 2020, 2:53 PM Ilija Tovilo wrote:
> Hi internals
>
> I'd
> Hi internals
>
> 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
On Tue, Jun 2, 2020 at 10:53 PM Ilija Tovilo wrote:
> Hi internals
>
> 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 contr
On 02/06/2020 22:52, Ilija Tovilo wrote:
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.
I like it a lot! Concise and clear RFC.
From having used a simi
Hi internals
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 circuiti
11 matches
Mail list logo