ID: 10332
Updated by: elixer
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Scripting Engine problem
PHP Version: 4.0.4pl1
Assigned To: 
Comments:

The "==" has higher precedence than does "xor," so evaluating left to right we have:

$h == 4 xor $i == 5 xor $j == 6
  or:
true xor true xor true
  then:
false xor true
  and finally:
true
  which is true, which is expected behavior.  Use parens to group the exressions to 
get the results you are looking for.

Sean

Previous Comments:
---------------------------------------------------------------------------

[2001-04-15 05:39:10] [EMAIL PROTECTED]
<?php
        $h = 4; $i =5, $j=6;
        if ($h == 4 xor $i == 5 xor $j == 6) {
        echo ("The condition is true");
        }
        else {
        echo ("The condition is false");
        }
?>

When i run it, i obtain The condition is true...
Im running PHP as Apache module.

---------------------------------------------------------------------------



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10332&edit=2


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to