foreach operator works for stub