Out of curiosity, are the two options below functionally equivalent?
$array_variable = function_that_creates_an_array();
foreach($array_variable as $a){
do_something()
}
vs.
foreach(function_that_creates_an_array() as $a){
do_something()
}
Just want to make sure I'm not calling the function on every iteration or anything dumb like that.
Thanks!