Feature Request
| From: | Michael McNally | Date: | Fri, 28 Mar 2008 07:24:54 +0000 |
| Subject: | Feature Request | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-1417@lists.php.net to get a copy of this message | ||
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.
Thanks.
Michael
---------------------------------
Never miss a thing. Make Yahoo your homepage.