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

From: Date: Fri, 17 Dec 1999 15:12:21 +0000
Subject: Re: [PHP4BETA] request: foreach ($array as $key => &$value)
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-8053@lists.php.net to get a copy of this message
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? read the subject;-)) foreach ($array as $key => &$value) -> by ref foreach ($array as $key => $value) -> normal.. from kuala lumpur airport... tc > > -Andrei > > If you find a job that you love, you'll > never work another day in your life. > - Mark Jackson > > Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!" Digital Collections Phone +49 40 235350 Fax +49 40 23535180 Hammerbrookstr. 93 20097 Hamburg / Germany

« previous php.version4 (#8053) next »