Let's properly throw in case of unclosed foreach and unclosed if statements