It seems that for the purpose of comparison, PHP converts both terms to boolean. Integers != 0 convert to true and strings != "" convert to true, so the terms are equivalent.

To force PHP to not convert anything (in which case different types always compare false), use === instead of ==.