Re: Feature Request

From: Date: Fri, 28 Mar 2008 09:44:51 +0000
Subject: Re: Feature Request
References: 1  Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-1418@lists.php.net to get a copy of this message
On Fri, Mar 28, 2008 at 8:24 AM, Michael McNally <michael_patrick_mcnally@yahoo.com> wrote: > Hello. > > When using multidimensional arrays in a loop it becomes very long to assign values directly > into the array. This feature will grant read and write access via short variable names to deeply > nested multidimensional array elements with sometimes incredibly long reference names. > > For example here is a common scenario: > > for ($element = 0; $element < count ($array); $element++){ > > if ($array[$element]['number'] == 1) $array[$element]['boolean'] = > 'True'; > > } > > That would be better addressed with this: > > for ($element = 0; $element < count ($array); $element++){ > > with ($array[$element]]){ > > if ($number == 1) $boolean = 'True'; > > } > > } > > Let me know if you are considering this functionality in a new version. It is just like the > With syntax in Visual Basic but used on nested arrays. with() has already been discussed on our development mailinglists, and we agreed not to add it. Please search the archives for more details. -Hannes

« previous php.webmaster (#1418) next »