Bug #17101: Parse errors involving control structures should indicate the start of it

From: Date: Wed, 08 May 2002 18:36:57 +0000
Subject: Bug #17101: Parse errors involving control structures should indicate the start of it
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-7258@lists.php.net to get a copy of this message
From: destes@ix.netcom.com Operating system: All PHP version: 4.1.2 PHP Bug Type: Feature/Change Request Bug description: Parse errors involving control structures should indicate the start of it A common scripting oversight is to forget to properly close control structures bounded by curly braces such as if: if ($var) { $foo = 1; $bar = 2; /* forgot the } */ ... When parsing this, PHP reports that the error occurred on the last line of the script - however many lines there are. For scripts that run many thousands of lines, and contain hundreds of control structures, this means a huge amount of time spent going over the entire code looking for the bad structure. It occurs to me that PHP should be able to determine where the START of the unended control structure is, and raise the parse error indicating that line (instead of the last line of the document). Adding this feature would greatly decrease debug times for people who occasionally make errors like these. Thanks, Steve -- Edit bug report at http://bugs.php.net/?id=17101&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=17101&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=17101&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=17101&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=17101&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=17101&r=support Expected behavior: http://bugs.php.net/fix.php?id=17101&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=17101&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=17101&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=17101&r=globals

« previous php.bugs (#7258) next »