#43931 [Opn]: "if: if(){} else:" causes problem

From: Date: Fri, 25 Jan 2008 00:48:26 +0000
Subject: #43931 [Opn]: "if: if(){} else:" causes problem
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-121523@lists.php.net to get a copy of this message
ID: 43931 Updated by: felipe@php.net Reported By: konstantin at schukraft dot org Status: Open Bug Type: Scripting Engine problem Operating System: Debian Linux 2.6.20 PHP Version: 4.4.8 New Comment: In this case, use ';' after bracket. e.g. if (true): if (true) { // do something }; else: // ... endif; Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#121523) next »