On Sun, 23 Mar 2025 at 12:52, Robert Chapin 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
> nu
On 3/25/2025 4:11 PM, Rowan Tommins [IMSoP] wrote:
Writing coalesce($foo, 0) or ($foo ?? 0) is a small cost when writing the code
to save cost every time anyone reads it.
I see, part of the concern is just avoiding implicit type coercion.
Yes, that would be an understandable reason to requir
On 25 March 2025 16:42:45 GMT, Robert Chapin wrote:
>On 3/25/2025 4:45 AM, Rowan Tommins [IMSoP] wrote:
>> The implied default in the first is 'off', but in the second it's 'on'.
>I thought the implied default was null.
By "implied", I'm talking about the observed behaviour: if you give it n
On 3/25/2025 4:45 AM, Rowan Tommins [IMSoP] wrote:
My point is that because null is not going to be coerced by the language to
either 'on' nor 'off', there's an implied default depending how you write the
expression.
That kind of user mistake is hard for me to wrap my mind around. I
don't exp
On 25 March 2025 05:53:30 GMT, Robert Chapin wrote:
>I may have over-simplified the examples. Comparing $input === 'yes' will have
>the same result whether $input is null or 'none' or an empty string. So not
>implying a result type, just want to compare a literal or other variable to
>$in
On 3/23/2025 11:10 AM, Larry Garfield wrote:
I'm not sure it justifies a new pseudo-function language construct.
Fair enough. Thank you for the feedback.
On 3/23/2025 2:37 PM, Rowan Tommins [IMSoP] wrote:
It's telling that all your examples with ?? put a value other than
null on the right-ha
On 23.03.25 19:37, Rowan Tommins [IMSoP] wrote:
I'm sympathetic to the problem you're trying to solve - the precedence
of ?? isn't always helpful - but I'm not sure I like the proposed
solution, for 3 reasons.
1) The name "nullc" is over-shortened and cryptic. The "c" looks almost
like an acc
On 23/03/2025 12:52, Robert Chapin 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 functio
On Sun, Mar 23, 2025, at 8:37 AM, Kamil Tekiela wrote:
> On Sun, 23 Mar 2025 at 12:52, Robert Chapin 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
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
10 matches
Mail list logo