[PHP-DEV] PHP 4.0 Bug #8582 Updated: normal if nested in alternate if gives parse error From: stas <email protected>
Date: 01/08/01

ID: 8582
Updated by: stas
Reported By: wojas <email protected>
Old-Status: Open
Status: Closed
Bug Type: Scripting Engine problem
Assigned To:
Comments:

Indeed the parser thinks else is a part of second construct
and chokes on ":". I'd suggest first to switch to newer {}
syntax, and then bracket your ifs so that you are sure you
and the parser agree on what is the part of what.

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

[2001-01-07 20:09:41] wojas <email protected>
The following php code gives a parse error at the 'else:'

<?php
if(1==1):
        echo "ok so far<p>";
        if(1==1) echo "error here!";
else:
        echo "Not possible";
endif;
?>

It looks like php thinks the 'else:' is part of the second
if construct; the following code works:

<?php
if(1==1):
        echo "ok so far<p>";
        if(1==1) echo "error here!";
        echo "void";
else:
        echo "Not possible";
endif;
?>

Tested with 4.0.3pl1, 4.0.4RC3 and 3.0.18 on debian woody and potato.

---------------------------------------------------------------------------

Full Bug description available at: http://bugs.php.net/?id=8582

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>