note 15849 deleted from control-structures.else by irc-html
| From: | irc-html@php.net | Date: | Sat, 19 Jan 2002 19:19:33 +0000 |
| Subject: | note 15849 deleted from control-structures.else by irc-html | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-25234@lists.php.net to get a copy of this message | ||
I saw this note a few days ago and nobody answered to the question at the end. I am sure that many
of you know the right answer but, just to be sure that everyone will get the right one i'll
answer the question.
So the message was:
yohgaki@hotmail.com
14-Apr-2001 02:04
Common mistake with "else" is "dangling elseh statement.
Consider following code,
if (<expr>)
if (<expr>)
/* a line of code */
else
/* a line of code */
Is the gelseh belong to first gifh or second gifh statement?
It is more clear if you write the code like this,it's more suggestive.
if (expr)
if (expr)
/* a line of code */
else
/* a line of code */
So else belog to the second if.