As iackay said.
PHP has no memory between clauses. A || B means that A must be a logical test, and B must be a logical test. Your B is not a logical test; it’s a string. (Which will always evaluate to TRUE if said string is not Null)
Almost perfect.
You’ve got the simplification down. Now group your model_year clauses (wrap them in parenthesis)
I’m going to use letters to make it clear why:
A || B || C && D || E
Parse left to right. Here’s how the parser logics it out: (Ans = previous line’s answer.)
A || B. Fine.
Ans || C. Fine. Now we’ve got ‘Is it red, blue, or yellow’.
Ans && D. Now you’ve got “Is it red, blue, or yellow, and model year 2011”.
Ans || E. Er… now you’re asking "(Is it red, blue, or yellow and model year 2011) OR ( is it model year 2012). Not what you were looking for, because this will return true if the model year is 2012, regardless of color.
Personally, if i were coding it, i’d group it as:
(A || B || C) && (D || E)
(the grouping around A/B/C is not strictly necessary, but i do it anyway for my sanity.)