[PHP-DEV] Bug #838: Parser error in nested if From: agarcia <email protected>
Date: 10/09/98

From: agarcia <email protected>
Operating system: win95 and linux 2.035 RH5.0
PHP version: 3.0.5
PHP Bug Type: Parser error
Bug description: Parser error in nested if

<?
phpinfo();

This script causes a parser error:
<?
$a = $b = 2;
if ($a==2):
        if ($b==2) print "a=2 b=2<br>";
elseif ($a=3):
        print "a=3<br>"
endif;
?>
This script also fails:
<?
$a = $b = 2;
if ($a==2):
        if ($b==2) {print "a=2 b=2<br>"};
elseif ($a=3):
        print "a=3<br>"
endif;
?>

Based in the fact that this code isn't correct:

if ($b==2) print "a=2 b=2<br>";
elseif ($a=3):
     print "a=3<br>";
endif;

i think it's clear the elseif ($a=3):
belongs to the previous if sentence.

--
PHP Development Mailing List   http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe <email protected>
For help: php-dev-help <email protected>