Re: Extract ArrayAccessRead from ArrayAccess
| From: | Alexandru Pătrănescu | Date: | Mon, 27 May 2024 11:21:23 +0000 |
| Subject: | Re: Extract ArrayAccessRead from ArrayAccess | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-123434@lists.php.net to get a copy of this message | ||
On Mon, May 27, 2024 at 7:16 AM Valentin Udaltsov <
udaltsov.valentin@gmail.com> wrote:
> Hello, internals!
>
> Here's the idea: let's extract
>
ArrayAccess::offsetExists and
> ArrayAccess::offsetGet methods into a separate
> ArrayAccessRead
> interface (name can be different) and allow read operations `$exists =
> isset($object['key']) and $value =
> $object['key']` for objects of classes
> that implement this interface. ArrayAccess will then extend
> ArrayAccessRead and add the remaining 2 methods. Looks like
> this change
> should not break backward compatibility.
>
>
Please check this: https://externals.io/message/122609#122609
where Gina
analyzed and proposed a solution for this.
It looks like the DimensionReadable is exactly the same thing. Maybe also
DimensionFetchable if you consider returning by reference.
Maybe the improvement can be done in smaller incremental steps, but I think
it's better to agree on a complete solution for splitting ArrayAccess.
Regards,
Alex