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

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

“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\zendframework\zend-json\src\Decoder.php

Replace with,

In Encoder.php file of vendor\zendframework\zend-json\src\Encoder.php , replace curly braces with square brackets after every $utf8 in _utf82utf16 function.
i.e:

Replace with,

Solved!

If you have any doubts, just mention them in the Comments section below 🙂 I would be happy to help.

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

Thank you.

Get Weekly Updates

Never miss Magento tips, tricks, tutorials, and news.

Thank you for subscribing.

Something went wrong.

4.9
(based on 16 Reviews)

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

Leave a reply:

Your email address will not be published.