Symptoms
If you're debugging a website or display_errors is enabled in PHP, you might see an error like this:
PHP Deprecated: Array and string offset access syntax with curly braces is deprecated
in /wp-content/plugins/path/file.php on line 101
Description
PHP version 7.4 deprecated the curly brace {} for accessing array elements and string offsets. More information on this can be found in the RFC where this was fully explained and implemented.
Solution
The full solution for this issue would be to have the website administrator (or plugin developer) update their code to replace curly brackets with square brackets where this issue occurs. Making this change future-proofs the site code, as this deprecation notice will be replaced with a Fatal error in PHP 8 or later.
Workaround
The message can be worked around by disabling debugging that causes this message to display in the browser (such as display_errors), or else by changing the PHP version of the website temporarily to PHP version 7.3. The solution should be applied before the PHP version reaches EOL. Note that PHP 7.2 will reach EOL on November 30, 2020.
Comments
0 comments
Article is closed for comments.