tags:

views:

29

answers:

0

Possible Duplicate:
PHP: how is an array in a foreach loop read?

If I have a foreach loop that looks like this:

//$test->result() returns an array
foreach ($test->result() as $index=>$value) ...

Is there an appreciable performance difference as opposed to storing that result in a variable and then using that as the supplied array?

$result = $test->result();
foreach ($result as $index=>$value) ...

My guess is that there is no performance difference, save perhaps for the slight increase in memory used to store that $result variable.