|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-12-02 05:52 UTC] lynch@php.net
Description: ------------ Parse error: syntax error, unexpected $end 99 times out of a hundred this means they are missing a closing } How tricky would it be to make this message say what TOKEN is expected next, or something along the lines of "look for a missing '}', ')' or quote" or whatever gets the parser into this state?... Every newbie gets bit by this. Some of us got bit a lot. :-) PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 01:00:01 2025 UTC |
Thee are quite a few options. Given class Foo { public function bar() {} the next thing might be a "}" or "public" or "var" or "const" or a comment or ... the parser can't know. The parser can only tell you what is not allowed. There's a project for a new parser which tries to improve error messages.