check foreach and text contexts