Re: logical AND assignments

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 8, 2010 at 9:55 AM, Peter Lind <peter.e.lind@xxxxxxxxx> 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

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux