No hate here, I promise, this is funny actually.
For sbillard and all, because this is not obvious at all.
http://php.net/manual/en/language.operators.precedence.php
|| has precedence over =
, but
= has precedence over or
so I (now) think of || as more evaluative
like $a= $b || $c;
a should equal the or of b with c
whereas or is more procedural
$a=$b or $c();
if (! $a=b) then do something else $c()
which I guess is why one looks mathematical and one looks linguistic,
but that's not the right way to think either, the right way is to lookup the precedence.
So I did use it correctly, but the interpretation made was wrong or it broke after fixing the "style".
You can find many examples of php code that say
$a=$b or die();
(I had seen some when I correctly wrote and tested more or less that, not thinking much about it)
You don't find many with ||. They wouldn't last long.
This caused a big fight it seems on another issue, and it's not surprising, because while this difference is arguably useful, it seems a bit nuts, so much that nobody sane would suspect it. Some php author should suffer for thinking this was a clever idea.
But that's why I test my code, line by line as much as possible, before arguing about it.
Manuals are good too, but tests are better and form can't make up for that.
Given this difference one can argue either way whether a "style" choice to only use one version is good or bad or even really about style. I'd rather people know than just stick to a style not realizing why.
I'm glad we had this tangle.
I didn't know this either, but I think we all got schooled a little and don't need to be upset about it.
The fact that I had tested it and was darn sure I was right, probably amplified my frustration and impatience with sbillard and the fact that he was rightfully (but incorrectly) certain I was crazy made him think I was a stubborn moron. Of course there was already a powder keg between us. I think it's funny now :) And for a few hours maybe, I know something about php that sbillard doesn't :) haha. (all in fun really).
Sorry if this abuses the "issue" board. I don't know another good place to post it and little pitfalls like this are I think worth spamming about sometimes independently of the closed discussion they came up in.