[PHP-DEV] Bug #329: inconsistency with if-elseif-else-endif loops From: info <email protected>
Date: 04/29/98

From: info <email protected>
Operating system: FreeBSD
PHP version: 3.0 Release Candidate 4
PHP Bug Type: Parser error
Bug description:
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.

This doesn't seem to be the case
when writing to a file with the
"fputs" command?!?!?

This e.x. will not work:

<?$fd = popen("/usr/sbin/sendmail -t","w");
fputs($fd, "to: someone <email protected>\n");
fputs($fd, "from: someone <email protected>\n");
fputs($fd, "subject: header\n\n");
fputs($fd, "\n\n");
$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:

fputs($fd, "line1\n");

otherwise it will not work???

Try out this url - where I have
an example running and see the
parse error message it produces:

http://wizards.dk/hotel/mf/shop/test.phtml

Best Regards
Keld Vraakjaer