<?php if ($foo = $bar) … ?>
PHP sure has some weird conditional matches. I thought it was a general rule that "if ($foo = $bar)" always evaluated TRUE unless $bar was NULL. But apparently that's not the case in PHP:
Case 1:
Case 2:
Case 3:
Case 4:
Case 5:
I can understand case 1 and maybe case 2, but cases 3 and 4 were surprising to me. I wonder if it's the same in C, assuming the variables are already declared? It's been a long time since I've coded in C, but I don't remember it being this way.