Skip to content

Commit

Permalink
4.0 | Tokenizer/PHP: defer to predefined regex
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfnl committed Nov 9, 2023
1 parent 74c422f commit 6247252
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Tokenizers/PHP.php
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ protected function tokenize($string)

if ($tokenIsArray === true
&& ($token[0] === T_STRING
|| preg_match('`^[a-zA-Z_\x80-\xff]`', $token[1]) === 1)
|| preg_match(self::PHP_LABEL_REGEX, $token[1]) === 1)
) {
// Get the next non-empty token.
for ($i = ($stackPtr + 1); $i < $numTokens; $i++) {
Expand Down

0 comments on commit 6247252

Please # to comment.