there's a typo here which unfortunately php -l wouldn't catch because $messageTemplates>id could be a legitimate comparison between a variable and a constant :(