[php-src] Issue #8043: token_get_all incorrectly identifies matching named parameters as PHP keywords
| From: | iluuu1994 | Date: | Sat, 05 Feb 2022 17:40:49 +0000 |
| Subject: | [php-src] Issue #8043: token_get_all incorrectly identifies matching named parameters as PHP keywords | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-239501@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8043
Comment Author: iluuu1994
This is correct. Tokenization (mostly) is context independent. The parser accepts
identifiers as named params.
https://github.com/php/php-src/blob/706398fa9fb081c6385c66ac8af1fe952c80f17d/Zend/zend_language_parser.y#L875-L876
Which allow both T_STRINGs and semi_reserved.
https://github.com/php/php-src/blob/706398fa9fb081c6385c66ac8af1fe952c80f17d/Zend/zend_language_parser.y#L318-L325