Skip to content

Commit cde502f

Browse files
committed
Fix bug with tokeniser
1 parent f3d66ac commit cde502f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Tokenizers/Tokenizer.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,13 @@ private function recurseScopeMap($stackPtr, $depth=1, &$ignore=0)
11421142
continue;
11431143
}
11441144

1145+
if ($tokenType === T_START_HEREDOC) {
1146+
// Heredocs are special because they can be used as a value, including
1147+
// inside a function call or as a default value for a parameter.
1148+
// So if we find them nested inside another opener, just skip them.
1149+
continue;
1150+
}
1151+
11451152
if ($tokenType === T_FUNCTION
11461153
&& $this->tokens[$stackPtr]['code'] !== T_FUNCTION
11471154
) {

0 commit comments

Comments
 (0)