Skip to content

Commit a5f9784

Browse files
committed
Tokenizer/PHP: minor bugfix for match tokenization
Oops.. still missed that one, even though I'd run the tests on various PHP versions locally so many times.... luckily CI caught it anyhow with one of the sniffs.
1 parent 8b0137a commit a5f9784

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Tokenizers/PHP.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,9 @@ protected function tokenize($string)
12901290

12911291
// Next was an open parenthesis, now check what is before the match keyword.
12921292
for ($y = ($stackPtr - 1); $y >= 0; $y--) {
1293-
if (isset(Util\Tokens::$emptyTokens[$tokens[$y][0]]) === true) {
1293+
if (is_array($tokens[$y]) === true
1294+
&& isset(Util\Tokens::$emptyTokens[$tokens[$y][0]]) === true
1295+
) {
12941296
continue;
12951297
}
12961298

0 commit comments

Comments
 (0)