Re: switch()
| From: | afan at afan dot net | Date: | Tue, 29 Aug 2006 19:36:09 +0000 |
| Subject: | Re: switch() | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-241197@lists.php.net to get a copy of this message | ||
> What you're saying in that case is either col_1 evaluates to value1 or
> col_2 evaluates to value2.
Correct. To be more specific (it was better I did from begining :))
After an "order" is submitted, the code is checking are there any coments
about tax charges (col_1) and/or billing charges (col_2). If there is
comment in col_1 send it by email to person in charge. If there is
something in col_2 send it by email to (other) person in charge. I hope it
does now make a sence. Sorry for this.
> Unless you have some program logic to
> prevent both from being true, you are comparing apples and oranges. And
> any time col_1, evaluates to true, the "break" keyword will stop your
> switch ladder. Remove break, and that won't happen. of course, if you
> do that, then the question arises about why you are using a switch
> ladder in the first place.
>
I forgot about this "break" (sounds crazy :)).
Thanks for making this clear to me.
-afan