Possible Duplicate:
How is an array in a PHP foreach loop read?
If I have this function:
function getList()
{
$list = array();
$list['foo'] = 'Foo';
$list['bar'] = 'Bar';
return $list;
}
And then I do this:
foreach ( getList() as $item )
{
echo $item.'<br>';
}
Will that code be slower than doing this:
$list = getList();
foreach ( $list as $item )
{
echo $item.'<br>';
}