I do not see this being flagged in PHP.
if ($querytype == “C”) {…
I think a rule should be added to flag (as at least an Info or bad style) this construct:
if ($var == ‘literal’ …)
and suggest
if (‘literal’ == $var… )
(and the double quote variant as well).
As a rule, the literal should be on the left hand side of “==” in most (all?) languages. Enforcing this rule helps to develop a style that avoid these errors:
if (‘literal’ = $foobar) //wont compile or run, but gets written
if ($foobar = ‘literal’) //dreadful bug to track
both the above should be flagged, and the developer writing that style should be flogged.