Also, in languages that support HEREDOCS, if you call the HEREDOC "SQL" then VIM and the Intellij editors will syntax-highlight the SQL.
By example:
$sql = "select myColFromTableB from tableA";
Inspection will give you have a "unknown column" warning.
(ps: sorry for late reply)