evernote-cloud-sdk-php
evernote-cloud-sdk-php copied to clipboard
Array and string offset access syntax with curly braces is deprecated
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.)
I have same issue. I'm using php 7.4.6
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```
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