0

I have an if statement that is always evaluating true even if none of the conditions are true. It goes like this:

if(condition1 || condition2 || condidion3)
{
//do stuff
}

For whatever reason even if none of the 3 conditions are actually true, it just runs anyway. Is there something weird in or statements that cause this? I have even tried putting each condition in parentheses just to see if it helps.

2
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by theighost
0

well, that means one of the conditions is definitely true..

Try to echo each condition variable and see which one is the one always true :) this is the simplest way

0

Gah, was a dumb error on my part. Gotta love mondays. Thanks yo.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.