foreach ( functionWithComplicatedComputationReturningAnArray() as $key => $value)
Will the above code call the function more than once?
And generally, are there rules in this regard, about PHP language constructs accepting function calls as parameters?
Thanks
Gidi
No, it will be called once. This:
is semantically equivalent to:
(ignoring the fact that the second one will leak the value outside the
foreachloop).