🔥 Just Launched! Werra Premium Template for HyväSee it in Action

Solved: Array and String Offset Access Syntax With Curly Braces is Deprecated in Magento 2

By Kishor ChhuganiUpdated on May 22, 2025 1 min read

“The way to succeed is to double your error rate!” best quote of the day but not relevant for developers as glued errors are always frustrated in Magento 2, right?

Especially, it’s so annoying when you don’t know what’s going on with your code, where’s wrong and why it displays the error.

Ever been in this kind of situation? Ever faced an error that says,

1 exception(s):
Exception #0 (Exception): Deprecated Functionality: Array and string offset access syntax with curly braces is deprecated in /vendor/magento/zendframework1/library/Zend/Json/Encoder.php on line 561

To solve the above error of array and string offset access syntax with curly braces is deprecated in Magento 2, check the below solution.

Solution For Array and String Offset Access Syntax With Curly Braces is Deprecated in Magento 2

You just have to replace curly braces with square brackets in /vendor/magento/zendframework1/library/Zend/Json/Decoder.php

$utf8 .= $chrs{$i};

Replace with,

$utf8 .= $chrs[$i];

In Encoder.php file of /vendor/magento/zendframework1/library/Zend/Json/Encoder.php , replace curly braces with square brackets after every $utf8 in _utf82utf16 function.
i.e:

chr(0x07 & (ord($utf8{0}) >> 2))

Replace with,

chr(0x07 & (ord($utf8[0]) >> 2))

Solved!

Feel free to share the solution with Magento community via social media.

Thank you.

Kishor Chhugani Full Image
Article byKishor Chhugani

He is a Magento developer at Meetanshi with a jolly, extrovert, & friendly personality. He loves playing cricket and is a passionate foodie!