Re: [PHP4BETA] request: foreach ($array as $key => &$value)

From: Date: Fri, 17 Dec 1999 22:44:54 +0000
Subject: Re: [PHP4BETA] request: foreach ($array as $key => &$value)
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-8109@lists.php.net to get a copy of this message
If returning refrences can be done (haven't checked it out yet) we should decide on one kind of behaviour. I woudln't make this configurable. Andi On Fri, 17 Dec 1999, Andrei Zmievski wrote: > On Fri, 17 Dec 1999, Andi Gutmans wrote: > > At 02:48 AM 12/17/99 +0100, Thies C. Arntzen wrote: > > >zeev, andi - > > > > > >would it be hard to implement this syntax, currently there's no good way > > >of traversion an array *without* coping the values (very bad if you have > > >lot's of subarrays). also we should enable foreach for objects as well i > > >think... > > > > It has been a while since we have touched foreach(). We should maybe > > consider changing it from copying to being a reference. I remember this was > > problematic but I'll try and think about it. It probably does make more > > sense as a reference. > > I feel that for consistency's sake and other considerations, it would be > better to allow the user to specify whether foreach() uses copy or > reference. Can it be done that way instead of hard-coding how the > assignment is done? > > -Andrei > > If you find a job that you love, you'll > never work another day in your life. > - Mark Jackson >

« previous php.version4 (#8109) next »