Re: Re: need help
| From: | Matt | Date: | Sun, 11 Aug 2002 14:27:39 +0000 |
| Subject: | Re: Re: need help | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-112022@lists.php.net to get a copy of this message | ||
> From: "B.C. Lance" <lornie@magix.com.sg>
> Sent: Sunday, August 11, 2002 10:17 AM
> Subject: Re: [PHP] Re: need help
> <snip>
> Matt wrote:
> > if(0 == $row['gid'])
> </snip>
> ahhh. let the parser do the check. works great if you are not comparing
> with 2 variables :)
>
> in fact, another way to avoid this kinda pitfall, switch is another
> alternative. but of course, switch has its pitfall too. <break> ;)
Yeah, it doesn't always work, but it adds to the reliablity of the code. In
my code, it's more often used then not. It's hard to think that way though,
as it's backwards logic, at least to me. I always think it first the other
way ($val == constant), and type it backwards :)