#32196 [Opn]: Operator Precedence
| From: | the_deppchef at hotmail dot com | Date: | Sat, 05 Mar 2005 01:06:38 +0000 |
| Subject: | #32196 [Opn]: Operator Precedence | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-74863@lists.php.net to get a copy of this message | ||
ID: 32196
User updated by: the_deppchef at hotmail dot com
Reported By: the_deppchef at hotmail dot com
Status: Open
Bug Type: Zend Engine 2 problem
Operating System: Linux 2.4.27 (Debian)
PHP Version: 4CVS-2005-03-05 (stable)
New Comment:
Uhm, sorry, my fault :(
Did this change recently? I really had it in mind the other way round
:(
Previous Comments:
------------------------------------------------------------------------
[2005-03-05 02:01:15] the_deppchef at hotmail dot com
Description:
------------
Operator Precedence doesn't seem to work as in earlier
versions/expected.
Following
http://de.php.net/manual/en/language.operators.php#language.operators.precedence
&& should have a higher priority than "or" and || should have a higher
priority than "and".
It doesn't work anymore..
Reproduce code:
---------------
<?php
$foo1=1;
$foo2=1;
$foo3=0;
if($foo1==0 && $foo2==0 or $foo3==0){
echo '<br>This should not happen';
}else{
echo '<br>This should happen';
}
$bar1=0;
$bar2=1;
$bar3=1;
if($bar1==0 || $bar2==0 and $bar3==0){
echo '<br>This should happen';
}else{
echo '<br>This should not happen';
}
?>
Expected result:
----------------
This should happen
This should happen
Actual result:
--------------
This should not happen
This should not happen
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=32196&edit=1