diff --git a/src/Tokenizers/PHP.php b/src/Tokenizers/PHP.php index 55baf41689..6e500e6cd1 100644 --- a/src/Tokenizers/PHP.php +++ b/src/Tokenizers/PHP.php @@ -786,7 +786,7 @@ protected function tokenize($string) if ($tokenIsArray === true && ($token[0] === T_DOC_COMMENT - || ($token[0] === T_COMMENT && strpos($token[1], '/**') === 0)) + || ($token[0] === T_COMMENT && strpos($token[1], '/**') === 0 && $token[1] !== '/**/')) ) { $commentTokens = $commentTokenizer->tokenizeString($token[1], $this->eolChar, $newStackPtr); foreach ($commentTokens as $commentToken) { diff --git a/tests/Core/Tokenizer/Comment/SingleLineDocBlockTest.inc b/tests/Core/Tokenizer/Comment/SingleLineDocBlockTest.inc index 5775ea563e..923e0fc1b2 100644 --- a/tests/Core/Tokenizer/Comment/SingleLineDocBlockTest.inc +++ b/tests/Core/Tokenizer/Comment/SingleLineDocBlockTest.inc @@ -1,5 +1,8 @@ '/**/'], + ]; + + $target = $this->getTargetToken('/* '.__FUNCTION__.' */', [T_COMMENT, T_DOC_COMMENT_OPEN_TAG]); + + $this->checkTokenSequence($target, $expectedSequence); + + }//end testEmptyBlockCommentNoWhiteSpace() + + /** * Verify tokenization of an empty, single line DocBlock. *