[php-src] Issue #8043: token_get_all incorrectly identifies matching named parameters as PHP keywords

From: Date: Sat, 05 Feb 2022 17:03:43 +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-239500@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/8043 Author: Naktibalda ### Description The following code: ```php $code ='<?php foo(echo: 4);'; $tokens = token_get_all($code); var_dump(token_name($tokens[3][0]), $tokens[3][1]); ``` Resulted in this output: ``` string(6) "T_ECHO" string(4) "echo" ``` But I expected this output instead: ``` string(8) "T_STRING" string(4) "echo" ``` https://3v4l.org/Kr7R5#v8.1.2 ### PHP Version PHP 8.1.2 ### Operating System _No response_

« previous php.bugs (#239500) next »