Re: ArrayAccess::offsetGet not returning a ref

From: Date: Tue, 27 Apr 2010 16:45:38 +0000
Subject: Re: ArrayAccess::offsetGet not returning a ref
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-48116@lists.php.net to get a copy of this message
Hi, On Tue, 2010-04-27 at 10:17 +0200, Etienne Kneuss wrote: > it looks like the fact that ArrayAccess::offsetGet is not returning a > reference is a recurrent problem, I see basically 4 options: The main use case is some nested structure like $o = new ArrayObject(); /*...*/ $o[23][42] = "foobar"; right? > a) Ignore the issue, change nothing > > b) Rewrite offsetGet to return a ref, breaking BC > > c) Create a new ArrayAccess interface where it does return a ref > > d) Relax prototype checks so that both are allowed. If the above case is correct and due to me not liking references I wonder whether there is a way to for an option e) which adds support for this in some way to the engine. johannes

« previous php.internals (#48116) next »