Re: [RFC] anti-coalescing-operator
| From: | Stephen Reay | Date: | Thu, 24 Oct 2019 17:46:08 +0000 |
| Subject: | Re: [RFC] anti-coalescing-operator | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-107663@lists.php.net to get a copy of this message | ||
> On 25 Oct 2019, at 00:33, Dan Ackroyd <Danack@basereality.com> wrote:
>
>> On Thu, 24 Oct 2019 at 18:21, Ken Stanley <dohpaz@gmail.com> wrote:
>>
>> Since PHP 7.0 brought forward the Null Coalescing Operator (??), writing
>> more succinct code for how to handle null values has been a blessing. But,
>> what about the inverse when you want to do something when a value is not
>> null?
>
> Hi Ken,
>
> It may help to give a real world example, rather than a metasyntactic
> one, as I can't immediately see how this would be useful.
>
> People have been expressing a concern over 'symbol soup' for similar
> ideas. The null colalesce scenario happens frequently enough, that it
> seemed to overcome the hurdle needed for acceptance. Again, giving a
> real world example of what you currently need to do frequently might
> help other people understand the need.
>
> cheers
> Dan
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Hi Ken,
This sounds like an alternative approach (for solving the same basic problem) to the nullsafe
operator discussed a while back, no?
https://wiki.php.net/rfc/nullsafe_calls
Cheers
Stephen