Re: [RFC] Improve language coherence for the behaviour of offsets and containers
| From: | Rob Landers | Date: | Sat, 27 Jul 2024 21:51:44 +0000 |
| Subject: | Re: [RFC] Improve language coherence for the behaviour of offsets and containers | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-124653@lists.php.net to get a copy of this message | ||
On Thu, Jul 4, 2024, at 15:52, Gina P. Banyard wrote:
> Hello internals,
>
> I would like to formally open the discussion on an RFC I've been working on for the past
> year:
> https://wiki.php.net/rfc/container-offset-behaviour
>
> As DokuWiki is a bit of a faff at times, the Markdown sources are available on GitHub:
>
> https://github.com/Girgias/php-rfcs/blob/master/container-offset-behaviour.md
>
> The implementation is basically done, other than some mysterious JIT issues that I haven't
> been able to pinpoint yet.
>
>
> Best regards,
>
> Gina P. Banyard
>
I apparently was sitting on a draft in this thread:
Hey Gina,
Is there potentially a 12th type of operation? It is implied multiple times, but not spelled out:
"offset exists" (i.e., "array_key_exists()" for arrays). The recent discussion
on pattern matching makes it seem like there is potentially a huge difference between "an
offset that exists" vs. "an offset with no value"; whether or not that is the case, I
believe it is an operation on a container? Maybe. I believe you are the subject-matter-expert on
this, by this point, for sure; so you would know. In any case, why or why wouldn't it be
considered an operation?
— Rob