Forum Moderators: coopster
$array['one'] = 'a';
$array['two'] = 'b';
$array['three'] = 'c';
$array['four'] = 'd';
$array['five'] = 'e';
// 0.00085210800170898s
while (list($key, $val) = each($array))
$$key = $val; // 0.0017039775848389s
foreach ($array as $key => $val)
$$key = $val; each() function
This function is far slower at iteration than a normal foreach, and causes implementation issues for some language changes. It has therefore been deprecated.
...is about twice as fast as this...