From: the_deppchef at hotmail dot com Operating system: Linux 2.4.27 (Debian) PHP version: 4CVS-2005-03-05 (stable) PHP Bug Type: Zend Engine 2 problem Bug description: Operator Precedence
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 bug report at http://bugs.php.net/?id=32196&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32196&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32196&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32196&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=32196&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=32196&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32196&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32196&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32196&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32196&r=support Expected behavior: http://bugs.php.net/fix.php?id=32196&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32196&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32196&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=32196&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32196&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=32196&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32196&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32196&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32196&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32196&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32196&r=mysqlcfg
