note 87723 deleted from control-structures.alternative-syntax by danbrown
| From: | danbrown@php.net | Date: | Thu, 18 Dec 2008 15:49:31 +0000 |
| Subject: | note 87723 deleted from control-structures.alternative-syntax by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-148319@lists.php.net to get a copy of this message | ||
Note Submitter: claude dot pache at gmail dot xxx
----
Beware that ambiguities arise in some occasions when you use a "if(...) {...}" construct
inside a "if(...): / else: / endif;" construct.
Once I wrote something like this:
<?php
if (foo):
lorem ipsum;
dolor sit amet;
if (bar) { quax; }
else:
lorem ipsum;
dolor sit amet;
endif;
?>
I've got an "unexpected ':'" error: Indeed, PHP had associated the
"else" to the "if(bar) { quax; }", and then didn't expect to find a colon
after the "else".
(At least, these sort of things do not yield bogus-but-runnable code.)