ID: 37995 Updated by: [EMAIL PROTECTED] Reported By: nisoi at mail dot ru -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux 2.6.15 / GENTOO PHP Version: 5.1.4 New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Never use both assignments/updates and comparison of the same variable in a statement. Previous Comments: ------------------------------------------------------------------------ [2006-07-03 07:54:58] nisoi at mail dot ru Description: ------------ Looks like there is the operator precedence problem in 5.1.4 (5.1.2 too). 4.4.2 works fine. When you try to compare the variable with the result of an assigning a value to it, both left and right parts are equal. But when you force the left part to evaluate in some way that does not change the value, left and right parts become different. Reproduce code: --------------- $i = 1; echo ( ( ($i) == ($i = $i + 1)) ? "BUG - THEY ARE EQUAL" : "OK")."\n"; echo ( ( ($i + 0) == ($i = $i + 1)) ? "BUG - THEY ARE EQUAL" : "FIX")."\n"; Expected result: ---------------- OK FIX Actual result: -------------- BUG FIX ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37995&edit=1
