PHP 4.0 Bug #4037 Updated: improper parsing of logical statements

From: Date: Sun, 30 Jul 2000 11:04:05 +0000
Subject: PHP 4.0 Bug #4037 Updated: improper parsing of logical statements
Groups: php.dev 
Request: Send a blank email to php-dev+get-26921@lists.php.net to get a copy of this message
ID: 4037 Updated by: zak Reported By: oded@geek.co.il Status: Feedback Bug Type: Scripting Engine problem Assigned To: Comments: I do not think that this is a bug. However, I have never been on to worry about the subtleties of operator precedence, so I may very well be wrong. Perhaps someone who understands this better can confirm, refute or lambast my explaination. The && has left associativity. The next operator on the left of the && is a +. && has a higher precedence than + ... so, before $t = $t + 1 can be evaluated, the && grabs 1 for its logical test, compares it to the result of the expression on the right and returns true. Thus it skips the addition and assignment operation on the left Full Bug description available at: http://bugs.php.net/?id=4037

« previous php.dev (#26921) next »