Skip to content

Commit 7b06040

Browse files
committed
Fix bug with tokeniser
1 parent b4118cc commit 7b06040

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
@@ -1073,6 +1073,13 @@ private function recurseScopeMap($stackPtr, $depth=1, &$ignore=0)
10731073
continue;
10741074
}
10751075

1076+
if ($tokenType === T_START_HEREDOC) {
1077+
// Heredocs are special because they can be used as a value, including
1078+
// inside a function call or as a default value for a parameter.
1079+
// So if we find them nested inside another opener, just skip them.
1080+
continue;
1081+
}
1082+
10761083
if ($tokenType === T_FUNCTION
10771084
&& $this->tokens[$stackPtr]['code'] !== T_FUNCTION
10781085
) {

0 commit comments

Comments
 (0)