Jump to content

Shorty and/or Operators


Recommended Posts

I'm confused about the interaction of and/or operators and parentheses.

 

My understanding is that && is higher priority than || which is priority than AND, so

 

{$A && $B && $C || $D && $E}

means "(A and B and C) or (D and E)", while

 

{$A AND $B && $C || $D && $E

means "A and ((B and C) or (D and E))." But aren't parenthesis even higher priority than &&, meaning that

 

{$A && ($B && $C || $D && $E)}

also means "A and ((B and C) or (D and E))"? Doesn't that mean that

 

{$A AND ($B && $C || $D && $E)}

is redundant?

Edited by jleesaxon (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...