Why is there variable 'i' for incrementation if you are using foreach?