On Mon, May 16, 2011 at 2:15 PM, Felipe Pena <felipe...@gmail.com> wrote:
> Hi all, > As I have proposed previously in an old thread... What about we name all > the > tokens to have an improved parser error message? (i.e. anymore > T_PAAMAYIM_NEKUDOTAYIM, T_DOLLAR_OPEN_CURLY_BRACES in the messages etc) > > Some examples: > > $ sapi/cli/php -r 'function ""' > Patched: > Parse error: syntax error, unexpected quoted-string, expecting identifier > or > '(' in Command line code on line 1 > > Current: > Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting > T_STRING or '(' in Command line code on line 1 > > > $ sapi/cli/php -r 'echo ::a;' > Patched: > Parse error: syntax error, unexpected :: in Command line code on line 1 > > Current: > Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in Command > line > code on line 1 > > Other examples and patch at: > https://wiki.php.net/rfc/improved-parser-error-message > > Any thoughts? > > Thanks. > > -- > Regards, > Felipe Pena > +1 do you think that this could cause some kind of BC? I don't think that anybody out there parses the tokens as is, but there are crazy people. :) the other thing that I can imagine that the developers will be surprised that they are getting meaningful error messages, but I think they can live with that. :) Tyrael