RE: [PHP] nested if parse error

From: Date: Fri, 31 May 2002 09:23:25 +0000
Subject: RE: [PHP] nested if parse error
Groups: php.general 
Request: Send a blank email to php-general+get-100062@lists.php.net to get a copy of this message
> -----Original Message----- > From: Miroslav Figlar [mailto:mfiglar@genesispo.sk] > Sent: 31 May 2002 07:26 > To: php-general@lists.php.net > Subject: Re: [PHP] nested if parse error > > > anyway it's funny that this works fine :-) > <? > if (1): > if (1) echo "hello"; > $a = 1; // here can be anything else > else: > endif; > ?> Nope, that makes perfect sense too. Think about where your second if(1) terminates -- is it still "open" when the parser reaches the "else:"? As I said before, it just gets way too confusing if you try to mix the :-type syntax with anything else: if you use it at all, use it for *everything*. Cheers! Mike --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: m.ford@lmu.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

« previous php.general (#100062) next »