Your code tells about you more than you think

This translates to: “If the value is not true, than set it to false. If the value is false, set the error message”. As you see, there is some room for improvement here: there is no need to set the value to false if it is not true because it is already false.

When you code, think what you write. The code above tells that the author either does not know PHP well enough or he is not thinking clearly.