fix Issue 13275 - Wrong di header generation on if and foreach statements
Merge pull request #3861 from 9rnsr/fix13275

Issue 13275 - Wrong di header generation on if and foreach statements