[PHP-DEV] Bug #838 Updated: Parser error in nested if From: Bug Database (php-dev <email protected>)
Date: 10/09/98

ID: 838
User Update by: agarcia <email protected>
Status: Open
Bug Type: Parser error
Description: Parser error in nested if

<?
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.

Full Bug description available at: http://ca.php.net/bugs.php3?id=838

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