On Sun, 25 Jul 2004 15:42:42 +0200 "rush" <[EMAIL PROTECTED]> wrote:
> "Jason Davidson" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > ah right.. :)
> > Jason
> 
> OR has a very low priority , and right argument is not evaluated if left
> one is true.

Same thing happens with ||, FWIW. The if condition is not evaluated further
than it needs to be in either case.

> In other words OR is here so that you could in pre exception
> handling days easily write something like this:
> 
> mysql_query(...) OR die;

This also works with ||:

mysql_query(...) || die;

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.

-- 
Skippy - Romanian Web Developers - http://ROWD.ORG

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to