note 44988 added to language.operators
| From: | php-general at lists dot php dot net | Date: | Sun, 22 Aug 2004 16:51:22 +0000 |
| Subject: | note 44988 added to language.operators | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-75118@lists.php.net to get a copy of this message | ||
I think warhog's note about the differing precedence between && / AND and || / OR is
worth repeating. Since && and || evaluate before the assignment operator (=) while AND and
OR evaluate after it, you can get COMPLETELY different results if you don't fully parenthesise.
I cannot imagine when it would ever be important that those two pairs have differing precedence, but
they do. And I just spent two hours discovering that the hard way because I broke my career-long
rule:
*Always fully parenthesise!*
----
Manual Page -- http://www.php.net/manual/en/language.operators.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44988
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44988&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44988&report=yes
Search -- http://master.php.net/manage/user-notes.php