Re: If 1 IF fails, do the rest anyway...
| From: | Chris Hewitt | Date: | Thu, 13 Mar 2003 21:55:40 +0000 |
| Subject: | Re: If 1 IF fails, do the rest anyway... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139608@lists.php.net to get a copy of this message | ||
Liam Gibbs wrote:
I know that in a case like this if((test1) && (test2) && (test3)) { ... } if test1 fails, dear PHP won't bother doing test2 and 3. Am I correct? Is there a syntax that will make it carry on with test2 and 3 anyway, regardless of how test1 came out?The more efficient compilers/parsers stop when one test fails, some do them all. I don't know which php does but surely it is irrelevant? If test1 fails, because of the "and" the "if" statement will not be executed. I wonder what the reason is for your wanting it to do test2 and test3, maybe I'm missing something? HTH Chris