in reply to if statement used in foreach-loop?

but the second code I get print, if it contain 3 element or more.
I do not believe that. Care to provide a short, runnable, example that shows this?