Closed
Description
The Coding Standard Tutorial page contains an example of a sniff to disallow hash comments: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Coding-Standard-Tutorial#disallowhashcommentssniffphp
The code uses curly braces for array offset access, which causes a fatal error in PHP >= 8.0:
if ($tokens[$stackPtr]['content']{0} === '#') {
The line above should be replaced with the following:
if ($tokens[$stackPtr]['content'][0] === '#') {