while(list($key, $value) = each($array)) vs. foreach($array as $key => $value)?

Viewed 74024

Recently I experienced this weird problem:

while(list($key, $value) = each($array))

was not listing all array values, where replacing it with...

foreach($array as $key => $value)

...worked perfectly.

And, I'm curious now.. what is the difference between those two?

4 Answers
Related