Re: Re: Proposal for RFC to remove undefined array index warning when used ina ternary
| From: | Robert Landers | Date: | Sun, 27 Feb 2022 08:27:26 +0000 |
| Subject: | Re: Re: Proposal for RFC to remove undefined array index warning when used ina ternary | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-117148@lists.php.net to get a copy of this message | ||
>
> I would be against changing the behaviour of elvis/ternary operator.
> However, I remember seeing past suggestions to implement another operator.
> One that would fill the gap between null-coalesce and elvis operators. If I
> recall correctly, most of the time, these proposals end in consensus that
> such operator isn't really needed. See
> https://externals.io/message/89292#89292 and
> https://externals.io/message/101606#101610
> Maybe, it would be worthwhile to refresh a discussion about adding such
> operator to the PHP language?
>
I think it would be a worthwhile endeavor. Back then, this was only a
notice that could be ignored for the sake of brevity/conciseness, or just
to keep close syntax to a ported library from Javascript. With it being a
warning, it is much harder to ignore and there is no as-short equivalent.