#43931 [Opn->Bgs]: "if: if(){} else:" causes problem
| From: | tony2001@php.net | Date: | Mon, 28 Jan 2008 23:09:53 +0000 |
| Subject: | #43931 [Opn->Bgs]: "if: if(){} else:" causes problem | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-121620@lists.php.net to get a copy of this message | ||
ID: 43931
Updated by: tony2001@php.net
Reported By: konstantin at schukraft dot org
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Debian Linux 2.6.20
PHP Version: 4.4.8
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
Previous Comments:
------------------------------------------------------------------------
[2008-01-25 00:48:26] felipe@php.net
In this case, use ';' after bracket.
e.g.
if (true):
if (true)
{
// do something
};
else:
// ...
endif;
------------------------------------------------------------------------
[2008-01-25 00:44:22] konstantin at schukraft dot org
Description:
------------
This could be related to bug #18413, but here, I don't mix styles
within the same layer like it was done in 18413, therefor this code
should definitly work. PHP should be able to find associate the else
with the first if, not the second.
Reproduce code:
---------------
if(true):
if(true)
{
}
else:
endif;
Expected result:
----------------
Parsing without problems.
Actual result:
--------------
Parse error: syntax error, unexpected ':' in whatever.php on line X
where X is the line with the "else:"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=43931&edit=1