Thread: operators
View Single Post
  #12  
Old 11-05-2006, 07:36 PM
Novo Novo is offline
[TServerDeveloper]
Join Date: Jun 2006
Posts: 448
Novo will become famous soon enough
var1 != var2
1 != 2... So... That would be true. The other part... (var1 || var2) means true || true => true.

It works wonders on TRUE and FALSE... But... I think you found a bug?

Because, if you check it out... Everything that is not false (0) is true... So it should have both been false ( Theoretically )
But... The problem with my script ( and that of graal ) is it doesn't evaluate var1 and var2 as such.

(!var1) != (!var2) should be the RIGHT version... Hrm.

As for the echo part... I'd just do:
PHP Code:
echo( var1 xor var2 ); // returns 0 or 1 
Reply With Quote