evernote-cloud-sdk-php icon indicating copy to clipboard operation
evernote-cloud-sdk-php copied to clipboard

Array and string offset access syntax with curly braces is deprecated

Open greeven opened this issue 4 years ago • 3 comments

I am using PHP 7.4.4 and get the error Array and string offset access syntax with curly braces is deprecated using the Evernote Client.

Example:

$token = '<token>';
$sandbox = true;

$client = new \Evernote\Client($token, $sandbox);
$notebooks = $client->listNotebooks();

This fails in src/Thrift/Transport/THttpClient.php:100.

Changing

if ((TStringFuncFactory::create()->strlen($uri) > 0) && ($uri{0} != '/')) {

to

if ((TStringFuncFactory::create()->strlen($uri) > 0) && (substr($uri, 0, 1) != '/')) {

resolves the issue.

(I'm not sure if I could just clone the repo, create a branch, fix it and create a merge request. Please let me know if I could fix that myself as I have no experience in that.)

greeven avatar Apr 19 '20 11:04 greeven

I have same issue. I'm using php 7.4.6

findstar avatar Jul 09 '20 14:07 findstar

This is now producing fatals in PHP 8:

PHP Fatal error:  Array and string offset access syntax with curly braces is no longer supported in /Users/artpi/GIT/artpi-tools/vendor/evernote/evernote-cloud-sdk-php/src/Thrift/Transport/THttpClient.php on line 100```

artpi avatar Feb 15 '21 19:02 artpi

Same issue:

Array and string offset access syntax with curly braces is no longer supported in xxxxxxxxxxxxxxxx/vendor/evernote/evernote-cloud-sdk-php/src/Thrift/Transport/THttpClient.php on line 100

JimPirrie avatar Jun 22 '22 16:06 JimPirrie