Re: [PHP] If 1 IF fails, do the rest anyway...

2003-03-13 Thread Tom Rogers
Hi, Friday, March 14, 2003, 7:13:15 AM, you wrote: LG> I know that in a case like this LG> if((test1) && (test2) && (test3)) { LG> ... LG> } LG> 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, regar

Re: [PHP] If 1 IF fails, do the rest anyway...

2003-03-13 Thread Liam Gibbs
> 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, ma

Re: [PHP] If 1 IF fails, do the rest anyway...

2003-03-13 Thread Chris Hewitt
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 compile

Re: [PHP] If 1 IF fails, do the rest anyway...

2003-03-13 Thread Jason k Larson
That's exactly what logical operators are for. http://www.php.net/manual/en/language.operators.logical.php use || instead of && for allowing either to be true. if ((test1) || (test2) || (test3)) { \\ if any of these can return true, this will execute } HTH, Jason k Larson Liam Gibbs wrote: I kno

Re: [PHP] If 1 IF fails, do the rest anyway...

2003-03-13 Thread Ernest E Vogelsinger
At 22:13 13.03.2003, Liam Gibbs said: [snip] >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 test

[PHP] If 1 IF fails, do the rest anyway...

2003-03-13 Thread Liam Gibbs
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?