Re: Inspiration for a Tombstone.
| From: | Colin Guthrie | Date: | Fri, 27 Jun 2008 10:01:20 +0000 |
| Subject: | Re: Inspiration for a Tombstone. | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-276030@lists.php.net to get a copy of this message | ||
Dan Shirah wrote:
if ($user_name == "Dan S") { echo "Quit while you're ahead"; } exit;As I very humorously hinted at in a earlier mail on this thread, it is a very, very good idea to get into the habit of putting constants *first* in if/while/etc statements. if ("Dan S" = $user_name) PHP/C/C++ etc. Bombs with a syntax error. if ($user_name = "Dan S") Works silently and looks right at first glance. I forced myself to write things that way round a good number of years ago and it has served me well and caught a few potential mishaps. Col.