note 92972 added to control-structures.else
| From: | LarryH-C at osu1 dot php dot net | Date: | Mon, 17 Aug 2009 17:08:35 +0000 |
| Subject: | note 92972 added to control-structures.else | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-159566@lists.php.net to get a copy of this message | ||
When you escape out of HTML, you can get an UNEXPECTED T_ELSE error with the following:
Error:
<? if( $condition ) {
dosomething;
}
?>
<? else {
dosomethingelse;
}
?>
Correct:
<? if( $condition ) {
dosomething;
?>
<? } else {
dosomethingelse;
}
?>
Apparently the compiler thinks a ?> <? breaks the connection between the } and the else
----
Server IP: 208.69.120.35
Probable Submitter: 70.124.62.45
----
Manual Page -- http://www.php.net/manual/en/control-structures.else.php
Edit -- https://master.php.net/note/edit/92972
Del: integrated -- https://master.php.net/note/delete/92972/integrated
Del: useless -- https://master.php.net/note/delete/92972/useless
Del: bad code -- https://master.php.net/note/delete/92972/bad+code
Del: spam -- https://master.php.net/note/delete/92972/spam
Del: non-english -- https://master.php.net/note/delete/92972/non-english
Del: in docs -- https://master.php.net/note/delete/92972/in+docs
Del: other reasons-- https://master.php.net/note/delete/92972
Reject -- https://master.php.net/note/reject/92972
Search -- https://master.php.net/manage/user-notes.php