Deprecated: curly b...
 
Notifications
Clear all

Deprecated: curly braces/brackets

3 Posts
2 Users
0 Reactions
258 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 2: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 2 years 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 4:47 pm
(@jimmi)
Posts: 95
Estimable Member
 

Hi,

this is correct fix

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

Never say that something is impossible because there will be always some dummy who will do it.
URL for efiction site: https://www.hpfanfiction.cz/
php: 8.1.33 MariaDB 10.5
efic version: 4.0.x
mods: storyimage, notifications, storyend

 
Posted : 06/09/2023 7:42 am
Share: