I do not use list()/each(), I dont have any reason other then I find foreach simpler and easier to read.
foreach() does make a copy, in future versions you will be able to do a reference to the orig array, this will be nice.
foreach($array as $pos => &$val)
foreach does not loop throught the array twice as you may beleive. unless I am missunderstanding you.
$test['a'] = 'a';
$test['b'] = 'b';
$test['c'] = 'c';
this array has only 3 elements. php does not accually have numeric indexes, all arrays in php are asosiative. an array with number indexes are just asosiative indexes with the index names as numbers.
back to our example.
there are only 3 valid elements in this array.
$test[0]
$test[1]
$test[2]
are all invalid, they do not exisit.
back again, this means foreach only loops though assosiative indexes because thats all there is.
Chris Lee
lee@mediawaveonline.com