Re: Avoiding enum reserved keyword
Hi Nikita
> Another possibility would be to recognize T_ENUM in the lexer, but only if
> it is followed by whitespace and an identifier. This would possibly be
> friendlier for tooling using token_get_all(). It would not permit comments
> in between the tokens though.
Thanks for the suggestion. This approach seems to work well.
https://github.com/php/php-src/pull/6489/commits/4da3f3cc38b2b99004f3dcb67fd850a4f9608006
Hopefully this will make migrating to PHP 8.1 a little easier.
Ilija
Thread (4 messages)