Re: Re: If...Or...Else
| From: | rush | Date: | Mon, 26 Jul 2004 11:25:16 +0000 |
| Subject: | Re: Re: If...Or...Else | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191874@lists.php.net to get a copy of this message | ||
"Skippy" <skippy@zuavra.net> wrote in message
news:20040725231541.7472ccf7@xxx...
> I just wanted to make things clear, because the way you said it above may
> lead to misinterpretations, such as believing that || makes all the
elements
> in a condition evaluate even if not necessary, which is not true.
>
> So OR simply has lower precedence than ||, but no other hidden properties.
>
> Any idea why the need to have two logical operators with the same meaning
BUT
> different precedences? I dig the need to put in OR as an alias, but why
> confuse people with the precedence issue? One would tend to think || and
OR
> are perfectly interchangeable.
with OR you can write (and even get desirable result ;) :
$resultSet = mysql_query( abla dabla ) OR die("something");
since it OR has lower precedence than assignment operator =
rush
--
http://www.templatetamer.com/