Re: A serious bug? "or" operator gives out diffferent results depending on order of operands
| From: | Richard Lynch | Date: | Mon, 27 Dec 2004 03:15:02 +0000 |
| Subject: | Re: A serious bug? "or" operator gives out diffferent results depending on order of operands | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-205191@lists.php.net to get a copy of this message | ||
Bogdan Ribic wrote:
> $b1 = is_null($x) or ($y > 5);
> $b2 = ($y > 5) or is_null($x);
To add to what has been posted already:
If 'or' isn't what you want '||' probably *IS* what you want.
Watch out though -- Sometimes even the precedence of '||' isn't as
high/low as I hoped, and if in doubt, use parentheses to force things to
happen in the order you want.
--
Like Music?
http://l-i-e.com/artists.htm