I'm just curious as to why it was decided to implement foreach as:
foreach($array as $value)
instead of
foreach($array as $key)?
It seems to me that the latter is the more logical, since $value is
available as $array[$key], while there is no (AFAIK) easy way to obtain
$key given $array and $value.
I'm not complaining, just looking to understand.
I wondered about too, like I did list($key)=each($array) before foreach() was availbe, I´m now forced to assign the value too.
Would be nice if we had
foreach($array key $key)
or something like this,
foreach($array => $key) would not make sense...
--
o----------0-¬---------O-·---¬----o---®-----o o O ° .
| http://www.kiffen.de | pRoteçt y0ur bRaín |0 O ° ¤ °
·
0°·³°²'²³-¹'³´³°^°³~³²³°'³²²¨³²^³¹³²°²³`³º³°Þ °
o © ° . ·
| psychedelic experience | gott@kiffen.de | O ° o °
o-¬--o--0-----©-·--O-----o-----0-¤----------o 0 ° · ° . ¤ ·