Re: Is this valid: IF:.. ELSE: ENDIF:
| From: | Miguel Cruz | Date: | Sat, 04 May 2002 20:20:26 +0000 |
| Subject: | Re: Is this valid: IF:.. ELSE: ENDIF: | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-96082@lists.php.net to get a copy of this message | ||
On Sat, 4 May 2002, David Jackson wrote:
> Greeting ---
> I was handed a broken form that contain:
>
> IF (cond):
>
> .........
>
> ELSEIF:
>
> ......
> ENDIF:
>
>
> My Questions are:
> 1. Is this type of "IF:" code block valid in PHP4.x.x?
I think it is, but I've never heard of anyone using it. One teensy thing;
the endif should be followed by a semicolon rather than a colon, as it
terminates the compound statement.
Of course, most normal people use:
if (cond) {}
elseif (cond) {}
and 'endif' is then moot as the scope of the branch is terminated by the
last closing brace.
miguel