Today I was asked a question regarding PHP’s foreach statement: If the array through wich a script iterates is generated by a function, how often is this function called? In this example, will getArray() be called only once or three times?
$c = 0;
function getArray()
{
global $c;
echo (++$c) . [...]



