|
Posted by fiziwig on 03/12/06 09:36
I've been programming since the middle of the 20th century and I still
type '=' when I mean '=='. One trick I learned is this:
if ($string = 'fred') will NOT generate a syntax error.
if ('fred' = $string) WILL generate a syntax error. You can't assign a
variable to a constant.
Put the constants first in compares and if it's not '==' it will warn
you.
That doesn't solve you larger problem, but it might help avoid one
common debugging annoyance.
--gary shannon
Navigation:
[Reply to this message]
|