[Solved] Why is PHP handling the dangling else differently? [closed]
[ad_1] Your first code reads as $a = false; if ($a) { echo ‘A’; } if (false) { echo ‘B’; } else { echo ‘C’; } When you do not use braces, only the next statement (statement, not line) gets executed as part of that control structure. It is not ambiguous as this behaviour is … Read more