note 94615 deleted from control-structures.alternative-syntax by danbrown
| From: | danbrown@php.net | Date: | Sun, 15 Nov 2009 03:58:22 +0000 |
| Subject: | note 94615 deleted from control-structures.alternative-syntax by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-162916@lists.php.net to get a copy of this message | ||
Note Submitter: kevinarcher15 at hotmail dot com
----
Mixing alternative syntax with regular syntax within if statements will fail when a nested if
statement occurs right before the "else:". This happens because the "} else"
confuses the engine and flows with the nested if. Adding any line of code to separate the brace and
else will prevent the problem from occurring, but you should avoid mixing the syntax instead.
<?php
if(true):
if(true) {
// actions
}
else:
// actions
endif;
?>