Re: rename T_PAAMAYIM_NEKUDOTAYIM to T_DOUBLE_COLON
| From: | Felipe Pena | Date: | Mon, 01 Nov 2010 20:47:46 +0000 |
| Subject: | Re: rename T_PAAMAYIM_NEKUDOTAYIM to T_DOUBLE_COLON | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-50063@lists.php.net to get a copy of this message | ||
2010/11/1 Richard Lynch <ceo@l-i-e.com>
> On Fri, October 29, 2010 7:47 pm, admin wrote:
> > WTF is T_PAAMAYIM_NEKUDOTAYIM?
> >
> > This has to be THE most asked question by new php developers when they
> > come across it. Can we please change the token name to T_DOUBLE_COLON
> > so I don't have to hear about it constantly?
> >
> > Those that disagree don't do enough PHP support to know how often it
> > is
> > asked. it's worth it.
>
> -1
>
>
Instead of renaming the token, I prefer to associate a literal string to
each token, to have a legible error message, without the T_ being shown.
For example, we could use in the Bison grammar file:
%token T_PAAMAYIM_NEKUDOTAYIM "::"
So that the error message become:
$ sapi/cli/php -r '::'
Parse error: syntax error, unexpected :: in Command line code on line 1
Instead of the known "unexpected T_PAAMAYIM_NEKUDOTAYIM" one.
--
Regards,
Felipe Pena