Forum

Deprecated: curly b...
 
Notifications
Clear all

Deprecated: curly braces/brackets

3 Posts
2 Users
0 Likes
34 Views
Jan_AQ
(@jan_aq)
Posts: 1300
Noble Member
Topic starter
 

PHP Deprecated: Array and string offset access syntax with curly braces is deprecated in /home/headprefect/public_html/fanfiction/includes/corefunctions.php on line 369

 

corefunctions.php on line 369:

            $replace[$i] = str_pad($words[$j]{0}, strlen($words[$j]), "*");

This is the correct fix, as explained in the 7.4 documentation:

https://www.php.net/manual/en/migration74.deprecated.php#migration74.deprecated.core.array-string-access-curly-brace

Would the change be

corefunctions.php on line 369:

            $replace[$i] = str_pad($words[$j](0), strlen($words[$j]), "*");

Whoever said nothing is impossible never tried slamming a revolving door.

url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word

 
Posted : 21/08/2023 1:41 pm
Jan_AQ
(@jan_aq)
Posts: 1300
Noble Member
Topic starter
 

From

https://wordpress.org/support/topic/php-deprecated-array-and-string-offset-access-syntax-with-curly-braces/

 

PHP RFC: Deprecate curly brace syntax for accessing array elements and string offsets

Until this is fixed in the theme’s source, anyone bothered by the deprecation notice (like I am) can fix it by replacing the curly braces {} with square brackets [] in evolve/inc/support.php at line 170:

if ( !isset( $version{1} ) ) {

should be changed to

if ( !isset( $version[1] ) ) {
This post was modified 4 months ago by Jan_AQ

Whoever said nothing is impossible never tried slamming a revolving door.

url: https://www.potionsandsnitches.org/fanfiction
php: 7.4.33 msql: 5.6.51-community GPL
efic version: 3.5.5 latest patches: yes
bridges: none mods: challenges, tracker, story end, beta, word

 
Posted : 21/08/2023 3:47 pm
(@jimmi)
Posts: 37
Trusted Member
 

Hi,

this is correct fix

$replace[$i] = str_pad($words[$j][0], strlen($words[$j]), "*");
 
 
Posted : 06/09/2023 6:42 am
Share: