-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHP 7.4 throwing offset syntax with curly braces is deprecated message #2558
Comments
The problem exists for squizlabs/php_codesniffer 2.9.2 on PHP 7.4.2 PHP Deprecated: Array and string offset access syntax with curly braces is deprecated
I've made a few changes locally and those warnings disappear. |
@neomerx PHPCS 2.9.2 was the last release in the PHPCS 2.x series and AFAIK there will be no further updates. Please upgrade to PHPCS 3.5.0 or higher for compatibility with PHP 7.4 or to PHPCS 3.5.4 (or higher once released) for support in sniffs for PHP 7.4 syntaxes. |
Not up to me, but I very much doubt it would be accepted.
To be honest, that should not be a reason not to upgrade. More than anything, that's an IDE configuration issue and if I remember correctly, the thread already contains info on how to get round it. |
Thanks for the answer. You do underestimate how painful those |
@neomerx What's stopping you from configuring your IDE correctly to ignore the |
Many projects. It's easier to not to upgrade. Also, it would mean sorta accepting global namespace pollution. |
Where Excel file import in codeigniter, the problem exists for phpexcel 1.8.0 on PHP 7 A PHP Error was encountered Message: Array and string offset access syntax with curly braces is deprecated Filename: Shared/String.php Line Number: 529 Backtrace: File: /opt/lampp/htdocs/example/application/third_party/PHPExcel/Autoloader.php File: /opt/lampp/htdocs/example/application/third_party/PHPExcel/Autoloader.php File: /opt/lampp/htdocs/example/application/third_party/PHPExcel/Autoloader.php File: /opt/lampp/htdocs/example/application/third_party/PHPExcel.php File: /opt/lampp/htdocs/example/application/controllers/Flats.php File: /opt/lampp/htdocs/example/index.php |
hi did you find the solution..if yes pls provide me I am unable to export the data in excel format it showing error same of deprecated |
@ravinegi007 You're asking in the wrong repo about a project which is no longer maintained and has been replaced. |
If you get this error and you installed via composer, chances are that you have v2 installed, Try to run: |
Hello!
PHP_CodeSniffer/src/Config.php
Line 420 in f6fd848
Current version of PHP 7.4 (
PHP 7.4.0-dev (cli) (built: Jul 19 2019 10:22:49) ( ZTS )
) considers practice of using curly braces to address offset of a string/array as deprecated. PHPCS still works okay now but emits warnings:Changing brackets to square ones in
src/Config.php
should solve the problem.The text was updated successfully, but these errors were encountered: