KnowTheCode / kint-php-debugger

Kint PHP Debugger - WordPress Plugin
https://wordpress.org/plugins/kint-php-debugger/
0 stars 1 forks source link

PHP 7.4 deprecates curly braces for array and string offset access #1

Open jdorner4 opened 3 years ago

jdorner4 commented 3 years ago

Love the plugin!!! THANK YOU!!!

With PHP7.4, array and string offset access syntax with curly braces is deprecated

https://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php/59158847#59158847

PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in \wp-content\plugins\kint-php-debugger\src\kint-php\kint\inc\kintParser.class.php on line 463

PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in \wp-content\plugins\kint-php-debugger\src\kint-php\kint\inc\kintParser.class.php on line 465

Easy fix - replace line 463: if ( $key{0} === "\x00" ) { with: if ( $key[0] === "\x00" ) {

and line 465: $access = $key{1} === "*" ? "protected" : "private"; with: $access = $key[1] === "*" ? "protected" : "private";

Hope this helps.

jdorner4 commented 3 years ago

Also found on \kint-php-debugger\src\kint-php\kint\parsers\custom\color.php on line 85 and \kint-php-debugger\src\kint-php\kint\parsers\custom\color.php on lines 92-94 and \kint-php-debugger\src\kint-php\kint\parsers\custom\json.php line 9