Posted by Hendri Kurniawan on 05/02/07 04:43
groups2@reenie.org wrote:
> Why does this test as not true.
>
> if (!1==2) echo 'true'; else echo 'nottrue';
>
> It seems like it should be true.
>
IMHO Operator precedence.
you are negating 1 instead the whole expression.
How to negate whole expression:
if (!(1==2)) echo 'true'; else echo 'nottrue';
Hendri Kurniawan
[Back to original message]
|