Hi,
just a guess: At compile time the compiler knows that the expression in the if statement will always evaluate to a constant 2, the if clause is probably meaningless, you get a warning. In the case of if ($foo = $bar) it may be intended, but anyway: The compiler can't evaluate the if clause to a constant as $bar can be true or false, so the conditional if may make sense.
Best regards
McA
In reply to Re: No warning when assiging to a variable
by McA
in thread No warning when assiging to a variable
by mikeraz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |