Maybe magic implementation was a better idea for [] overrieding like for __get, __set, __isset and __unset stuff. For example __offsetGet, __offsetSet, __offsetUnset and __offsetExists (or __offsetIsset). This way people will be free using return by ref or not and also may implement only some of the methods, e.g. only __offsetGet.
On 25/11/05, Marcus Boerger <[EMAIL PROTECTED]> wrote: > Hello Oliver, > > feel free to write an interface that supports return by reference and be > done. > > Having ArrayAccess in use we had to chose one of two possibilities. First > go with return by reference and second go with return by copy. We chose > return by copy simply because that was the intended use anyway. That it was > possible to add return by reference to its signature was an error in the > first place. Actually one that we mentioned very early. But this is again > ignorance and maybe not writing every tiny piece of change n some document > that nobody reads anyway. And oh it is in th NEWS file. > > marcus > > Friday, November 25, 2005, 8:47:44 PM, you wrote: > > > Sara Golemon schrieb: > >> ArrayAccess interface for the dimension read/write. > > > Just to bring the issue up agaian: The current ArrayAccess > > implementation does not allow for proper simulation of arrays. This has > > been "broken by fixing" (tm) the method prototypes not to allow "&" > > anymore in interface implementations where the interface doesn't specify > > a "&" for the corresponding method and at the same time not changing > > ArrayAccess to feature a "&" for offsetGet. > > =>> You can't do > > > $ArrayAccesImplementingObject['virtual offset'][]='test'; > > > for offsets that are arrays. > > > OLLi > > > > > Best regards, > Marcus > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php