Re: A serious bug? "or" operator gives out diffferent results depending on order of operands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux