Re: [PHP] logical AND assignments

2010-09-08 Thread David Harkness
On Wed, Sep 8, 2010 at 9:55 AM, Peter Lind wrote: > || and && would work exactly like 'or' and 'and' in the above. ==, !=, > === and !=== have higher precedence than || or && > Ah, you're correct. The only operators between &&/|| and and/or and the ternary ?: and assignment operators. Thus the n

Re: [PHP] logical AND assignments

2010-09-08 Thread David Harkness
The reason for "and" to have such a low precedence is so you can use it to perform conditional processing. You can probably achieve every effect using "&&", but you'd need more parentheses. More typically you would use "or" in this fashion: defined('DS') or define('DS', DIRECTORY_SEPARATOR);

Re: [PHP] logical AND assignments

2010-09-07 Thread Paul M Foster
On Tue, Sep 07, 2010 at 10:41:46PM -0400, Robert E. Glaser wrote: > My ISP upgraded his server from Ubuntu 9.04 to Ubuntu 9.10, which > probably included a newer PHP version. I don't know what PHP version > was on previously. Code I've had running for years broke, and I tracked > it down to this

[PHP] logical AND assignments

2010-09-07 Thread Robert E. Glaser
My ISP upgraded his server from Ubuntu 9.04 to Ubuntu 9.10, which probably included a newer PHP version. I don't know what PHP version was on previously. Code I've had running for years broke, and I tracked it down to this equivalent: "; $Condition0 = true and false; If ($Condition0) ec