Posted by groups2 on 05/02/07 18:50
On May 2, 12:43 am, Hendri Kurniawan <ask...@email.com> wrote:
> grou...@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
Ok thanks. That makes sense. Or, of course,
if (1!=2)) echo 'true'; else echo 'nottrue';
[Back to original message]
|