From: [EMAIL PROTECTED]
Operating system: Red Hat Linux 7.0
PHP version: 4.0.6
PHP Bug Type: Unknown/Other Function
Bug description: if...then...else problem
hi!
i noticed a problem with nested if...then...else s
Example:
if ($A==1):
if ($B==2) DoThis();
if ($C==3) DoThat();
else:
DoSomething;
endif;
in this case - the 'else:' on thr 4th line is regarded as an 'else'
continuing from the 'if' on the 3rd line.
this generates a parser error.
this may cause confusion to some of you (it did to me) but the workaround
is this:
if ($A==1) {
if ($B==2) DoThis();
if ($C==3) DoThat();
} else {
DoSomething;
}
--
Edit bug report at: http://bugs.php.net/?id=13026&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]