RE: [PHP-DEV] Bug #329: inconsistency with if-elseif-else-endif loops From: Shane Caraveo (shane <email protected>)
Date: 04/29/98

> I think this is a bug - if it is supposed
> to be this way, I sure don't see the
> why?!?
>
> In PHP3 you're supposed to use ":"
> instead of ";" between the different
> statements in a if-elseif-else-endif
> loop.

not true.

> $a=1; if($a=1):
> fputs($fd, "line1\n"):
> fputs($fd, "line2\n");
> endif;
> pclose($fd)?>
>
> To make it work I had to use
> ";" instead of ":" in the first
> fputs line - like this:

You aren't supposed to use : after a statement. Only after if(): and else
if(): and else:. Statements in between need ;

Shane