Re: Feedback for nullc Idea

From: Date: Sun, 23 Mar 2025 15:10:36 +0000
Subject: Re: Feedback for nullc Idea
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Sun, Mar 23, 2025, at 8:37 AM, Kamil Tekiela wrote:
> On Sun, 23 Mar 2025 at 12:52, Robert Chapin <[email protected]> wrote:
>>
>> Hi PHP folks,
>>
>> I submitted a proposal on Monday that received no replies.  The idea was
>> about adding a functional construct nullc() that could act as an inline
>> null coalesce for a variable.  That task is currently not possible in a
>> nullc() user function, but instead requires an expression like ($var ??
>> null) with mandatory extra parentheses.  A functional expression could
>> make this less prone to mistakes.  It would also avoid concerns with
>> alternatives such as unary operators.
>>
>> Any feedback on this idea would be appreciated.
>>
>> -------------
>> Robert Chapin
>
> Hi Robert,
>
> For some reason, your emails are classified as spam. I am attaching
> the link to your previous email for the record.
> https://externals.io/message/126826
>
> Regards,
> Kamil

While I can somewhat see the use case, I'd argue that if you have a lot of that use case going
on then you should likely rethink your data structures.  (Eg, fewer arrays.)  That's not always
possible at the HTTP boundary (queries are arrays, of course), but if it becomes onerous, there are
better ways.  I'm not sure it justifies a new pseudo-function language construct.

--Larry Garfield


Thread (10 messages)

« previous php.internals (#126913) next »