Re: [PHP-DEV] Extract ArrayAccessRead from ArrayAccess

2024-05-27 Thread Valentin Udaltsov
On Mon, May 27, 2024 at 14:21 Alexandru Pătrănescu wrote: > > On Mon, May 27, 2024 at 7:16 AM Valentin Udaltsov < > udaltsov.valen...@gmail.com> wrote: > >> Hello, internals! >> >> Here's the idea: let's extract `ArrayAccess::offsetExists` and >> `ArrayAccess::offsetGet` methods into a separate `

Re: [PHP-DEV] Extract ArrayAccessRead from ArrayAccess

2024-05-27 Thread Alexandru Pătrănescu
On Mon, May 27, 2024 at 7:16 AM Valentin Udaltsov < udaltsov.valen...@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 ope

[PHP-DEV] Extract ArrayAccessRead from ArrayAccess

2024-05-26 Thread Valentin Udaltsov
Hello, internals! Recently I was implementing some collections and realized that I cannot use `ArrayAccess` for immutable collections without throwing `BadMethodCallException` in `offsetSet` and `offsetUnset`. I also cannot have an `interface ReadonlyCollection extends ArrayAccess`, because `offse