The first array is iterated BY REFERENCE, as the second array. This is because iterated elements are referenced (&$v) and so the original array MUST be affected. If you extend the array variable, the same iterated array is extended infinitely.
For the second array is the same case, but the condition test to perform the next iteration was done beforehand, so it doesn't matter the array is extended by one, it's marked as terminated in that test.
The third array is iterated by value (and thus copied). PHP does that if no reference is needed to the array (or array values in the foreach loop; or the array itself is not a reference regarding it's zval). So extending the array will not alter the iterated array (since it's a copy and not the array in the variable).
More: (guess where?) Here