squizlabs / PHP_CodeSniffer

PHP_CodeSniffer tokenizes PHP files and detects violations of a defined set of coding standards.
BSD 3-Clause "New" or "Revised" License
10.67k stars 1.48k forks source link

PHP Fatal error thrown with PHP 8.0.1 #3198

Closed divineniiquaye closed 3 years ago

divineniiquaye commented 3 years ago

I updated my PHP version from 7.3 to 8.0.1 in my Scrutinizer Ci account. Anytime I run phpcs tests, it fails with this error message:

PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /home/scrutinizer/.analysis/phpcs/vendor/squizlabs/php_codesniffer/src/Config.php on line 420

Phpcs tests works quite well in both my local environment, Travis and GitHub action. I've gone through the code at https://github.com/squizlabs/PHP_CodeSniffer/blob/master/src/Config.php#L420 but coudn't come up with a solution as I see no problem.

I will appreciate it if this issue get resolved.

jrfnl commented 3 years ago

@divineniiquaye Sounds like Scrutinizer is using an outdated version of PHPCS. Please contact their helpdesk and ask them to update to the latest release or set up Scrutinizer in a way that it will run the latest version via Composer yourself.

I suggest for this issue to be closed as there is nothing we can do about this as the code issue (PHP 7.4 related) was already fixed well over a year ago.

divineniiquaye commented 3 years ago

@divineniiquaye Sounds like Scrutinizer is using an outdated version of PHPCS. Please contact their helpdesk and ask them to update to the latest release or set up Scrutinizer in a way that it will run the latest version via Composer yourself.

I suggest for this issue to be closed as there is nothing we can do about this as the code issue (PHP 7.4 related) was already fixed well over a year ago.

Alright I'll contact them.

jrfnl commented 3 years ago

Side-note: PHPCS has run-time support for PHP 8.0 as of PHPCS 3.5.7 (i.e. all PHPCS functionality will work on PHP 8.0 without any errors), however, PHP 8.0 syntax support is not complete yet, i.e. when using new, PHP 8.0+ specific syntax, sniffs may throw incorrect errors as not all PHP 8.0 syntaxes are recognized correctly yet.

divineniiquaye commented 3 years ago

Oh okay, then I'll rather downgrade my PHP version till all syntaxes in PHP 8.0 are completed. Thanks.