Re: logical AND assignments
| From: | David Harkness | Date: | Wed, 08 Sep 2010 18:15:23 +0000 |
| Subject: | Re: logical AND assignments | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-307897@lists.php.net to get a copy of this message | ||
On Wed, Sep 8, 2010 at 9:55 AM, Peter Lind <peter.e.lind@gmail.com> wrote:
> || and && would work exactly like 'or' and 'and' in the above. ==,
> !=,
> === and !=== have higher precedence than || or &&
>
Ah, you're correct. The only operators between &&/|| and and/or and the
ternary ?: and assignment operators. Thus the need for the parentheses in
$Condition2 = (true and false);
to make $Condition2 false. The parentheses in
$Condition4 = (true && false);
are redundant since && has higher precedence than = (assignment).
Robert, how do the results differ from your expectations?
David