Skip to content

Commit 7ad38d7

Browse files
jrfnlgsherwood
authored andcommitted
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 43bea20 commit 7ad38d7

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
@@ -1135,7 +1135,9 @@ protected function tokenize($string)
11351135

11361136
// Next was an open parenthesis, now check what is before the match keyword.
11371137
for ($y = ($stackPtr - 1); $y >= 0; $y--) {
1138-
if (isset(Tokens::$emptyTokens[$tokens[$y][0]]) === true) {
1138+
if (is_array($tokens[$y]) === true
1139+
&& isset(Tokens::$emptyTokens[$tokens[$y][0]]) === true
1140+
) {
11391141
continue;
11401142
}
11411143

0 commit comments

Comments
 (0)