Posted by dandriff on Monday June 30, 2008@12:22PM
This comment at php.net contains a valuable piece of wisdom:
If you need to compare a variable with a value, instead of doing: <?php if ($foo == 3) bar(); ?> do: <?php if (3 == $foo) bar(); ?> This way, if/when you forget the second equals sign (=), the statement will become: <?php if (3 = $foo) bar(); ?> and PHP will evaluate the statement and report an error.