Order of && Operator

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Vmusic
Forum Newbie
Posts: 10
Joined: Sat Sep 07, 2002 8:45 am
Location: Columbus, Ohio

Order of && Operator

Post by Vmusic »

Hi,
Which order does PHP process the && operator?

if((a == "jo") && (b=="momma")){


what gets tested first??????????


Thanks!!!
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

User avatar
Bill H
DevNet Resident
Posts: 1136
Joined: Sat Jun 01, 2002 10:16 am
Location: San Diego CA
Contact:

Post by Bill H »

As a matter of readability, I use parentheses to specify order of operation even when operator precedence would do so for me. The issue is to make sure that when I read the code years from now I am clear on what I meant to happen.
Post Reply