` interpreted as an opening PHP tag. Previously it was interpreted either as * > ` interpreted as a literal `shortOpenTags = (bool) ini_get('short_open_tag'); if ($this->shortOpenTags === false) { $targets[] = \T_INLINE_HTML; } else { $targets[] = \T_STRING; } if (version_compare(\PHP_VERSION_ID, '70399', '>')) { $targets[] = \T_OPEN_TAG; } return $targets; } /** * Processes this test, when one of its tokens is encountered. * * @since 9.3.0 * * @param \PHP_CodeSniffer_File $phpcsFile The file being scanned. * @param int $stackPtr The position of the current token * in the stack passed in $tokens. * * @return void */ public function process(File $phpcsFile, $stackPtr) { if ($this->supportsBelow('7.3') === false) { return; } if ($stackPtr !== ($phpcsFile->numTokens - 1)) { // We're only interested in the last token in the file. return; } $tokens = $phpcsFile->getTokens(); $contents = $tokens[$stackPtr]['content']; $error = false; switch ($tokens[$stackPtr]['code']) { case \T_INLINE_HTML: // PHP < 7.4 with short open tags off. if ($contents === 'addError( 'A PHP open tag at the end of a file, without trailing newline, was not supported in PHP 7.3 or earlier and would result in a syntax error or be interpreted as a literal string', $stackPtr, 'Found' ); } } }