Properly handle unclosed PHP scripts