Fwd: [PHP-DEV] Nullsafe
| From: | Eugene Sidelnyk | Date: | Tue, 03 Nov 2020 19:18:20 +0000 |
| Subject: | Fwd: [PHP-DEV] Nullsafe | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-112163@lists.php.net to get a copy of this message | ||
---------- Forwarded message ---------
From: Eugene Sidelnyk <zsidelnik@gmail.com>
Date: Tue, Nov 3, 2020 at 7:08 PM
Subject: Re: [PHP-DEV] Nullsafe
To: Benjamin Morel <benjamin.morel@gmail.com>
But currently working code doesn't fail with NullPointerException?
Otherwise it would not be a working code.
Early fail will be when we try return / pass anywhere this value
On Tue, Nov 3, 2020, 6:48 PM Benjamin Morel <benjamin.morel@gmail.com>
wrote:
> On Tue, 3 Nov 2020 at 17:38, Eugene Sidelnyk <zsidelnik@gmail.com> wrote:
>
>> I am wondering why don't we use ordinary
->
>> operator with safe null
>> handling?
>
>
> Hi,
>
> - changing the current behaviour of -> would be a huge BC
> break
> - and if we need another reason, there are many situations where you do
> want to fail early if the left operand is null, so the current operator is
> a good fit
>
> — Benjamin
>