Re: ArrayAccess::offsetGet not returning a ref

From: Date: Tue, 27 Apr 2010 09:13:40 +0000
Subject: Re: ArrayAccess::offsetGet not returning a ref
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-48107@lists.php.net to get a copy of this message
On Tue, Apr 27, 2010 at 10:51, Peter Cowburn <petercowburn@gmail.com> wrote:
> On 27 April 2010 09:17, Etienne Kneuss <colder@php.net> wrote:
>> Hi,
>>
>> it looks like the fact that ArrayAccess::offsetGet is not returning a
>> reference is a recurrent problem, I see basically 4 options:
>>
>> a) Ignore the issue, change nothing
>>
>> b) Rewrite offsetGet to return a ref, breaking BC
> -1,000,000
>>
>> c) Create a new ArrayAccess interface where it does return a ref
>>
>> d) Relax prototype checks so that both are allowed.
>
> Of the options presented, I think d) would be the best of the bunch.
> Folks seem to expect the ability to get references so any solution
> that gives them that would be better IMO than keeping the interface
> as-is.

Without having the technical insight in how it works internally, I
would also say that from an end-user perspective, option (d) makes
most sense.

>>
>> Personally, I believe that a fatal on such prototypes error is not
>> warranted, so I'd prefer (d).
>>
>> What do you think would be the best option? Can you think of another?

-- 
Daniel Egeberg


Thread (12 messages)

« previous php.internals (#48107) next »