Re: Nullsafe
| From: | Josh Bruce | Date: | Wed, 04 Nov 2020 20:18:11 +0000 |
| Subject: | Re: Nullsafe | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-112185@lists.php.net to get a copy of this message | ||
> On Nov 4, 2020, at 1:38 PM, Eugene Sidelnyk <zsidelnik@gmail.com> wrote:
>
> Yeah... Creating null was a huge mistake.
> Now it is probably too late to fix that (maybe some new language can
> introduce that).
>
> But what do you think about introducing special class
>
NullObject?
I would rather let an instance be “empty” than to have a unique, separate thing that always
represents nothing. To be fair, I don’t know the specific NullObject implementation here - based
on presumption - I would intentionally be creating something that represents nothing.
See also this RFC: https://wiki.php.net/rfc/objects-can-be-falsifiable
<https://wiki.php.net/rfc/objects-can-be-falsifiable>
- sounds like this thread might bring more supporters to that table/discussion.
Cheers,
Josh