|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-01-06 13:15 UTC] jan@php.net
[2010-03-09 02:59 UTC] benni at cipher dot is
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 17:00:01 2025 UTC |
If you have a missing close-bracket "}" somewhere in your code, the PHP parser tells you that the error is at the last line. If you have a multi-hundred or thousand line file, this makes life a bitch. Rasmus tells me that the reason for this behavior is because functions can be nested, which means that: function a { function b { } } is OK. This is a silly feature. Why do you have it, for scoping reasons? It means that you can't effectively tell where syntax errors occur. Suggestion: Either make nested functions turned off by default but you can turn them on with a PHP global variable, like $PHP_BIZARRO_NESTED_FUNCTIONS = 1; or have the parser syntax set up so that it marks where a possible syntax error occurred (IOW it sees a possible nested function, but it could also be a syntax error), and if it reaches the end of the file with a missing "}" or two, that it displays the location where it parsed the nested function.