possibly unintended assignment
I have this piece of code
PHP Code:
Do I have to change it (to code below) or not? PHP Code:
|
Re: possibly unintended assignment
Use () around the expression.
|
Re: possibly unintended assignment
Quote:
|
Re: possibly unintended assignment
The if statement expects a conditional expression which generally is an expression to compare two or more values. A common conditional expression is to compare equality of two values using the "==" comparison symbol. So, when you try to assign a value to a variable instead of doing a typical conditional expression, it thinks that you might have mistakenly forgot to add the second equal sign.
So, to suppress the warning, you need to put your variable assignment in parentheses so that it tells the compiler that you are intentionally doing a variable assignment instead of having a typo in your conditional expression. Example: PHP Code:
|
Re: possibly unintended assignment
Quote:
|
| All times are GMT -4. The time now is 21:22. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.