ID: 13026
Updated by: derick
Reported By: [EMAIL PROTECTED]
Old Status: Open
Status: Bogus
Bug Type: Unknown/Other Function
Operating System: Red Hat Linux 7.0
PHP Version: 4.0.6
New Comment:

It's not really a bug, but a side-effect of the old syntax. The new one, with { } does 
not have this problem, and that's the recommended syntax anyways.
I'll mark this one as bogus.

Derick

Previous Comments:
------------------------------------------------------------------------

[2001-08-29 08:42:10] [EMAIL PROTECTED]

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 this 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]

Reply via email to