Re: Extract ArrayAccessRead from ArrayAccess

From: Date: Mon, 27 May 2024 13:20:16 +0000
Subject: Re: Extract ArrayAccessRead from ArrayAccess
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-123435@lists.php.net to get a copy of this message
On Mon, May 27, 2024 at 14:21 Alexandru Pătrănescu <drealecs@gmail.com> wrote: > > 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 ”ý®y >> àÖ{&æ…âŠõ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 > Wow! That's a great RFC with thorough analysis and an awesome proposal. Forget about my email 😄. Looking forward to news from Gina. -- Regards, Valentin Udaltsov

« previous php.internals (#123435) next »