Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array-style access of non-arrays in PHP 7.4 #207

Closed
spaze opened this issue Jan 7, 2020 · 9 comments
Closed

Array-style access of non-arrays in PHP 7.4 #207

spaze opened this issue Jan 7, 2020 · 9 comments
Assignees

Comments

@spaze
Copy link
Contributor

spaze commented Jan 7, 2020

Which service(blob, file, queue, table) does this issue concern?

azure-storage-common

Which version of the SDK was used?

1.4.1

What's the PHP/OS version?

PHP 7.4.1

What problem was encountered?

PHP 7.4 has forbidden array-style access of non-arrays:

Trying to use values of type null, bool, int, float or resource as an array (such as $null["key"]) will now generate a notice.

And on PHP 7.4 I'm getting:

ErrorException: Trying to access array offset on value of type null in /[path]/vendor/microsoft/azure-storage-common/src/Common/Internal/Http/HttpCallContext.php:417

Full stacktrace (most files are from our app but I'm attaching it for the sake of completeness, also keep in mind we have notices converted to exceptions):

ErrorException: Trying to access array offset on value of type null in /[path]/vendor/microsoft/azure-storage-common/src/Common/Internal/Http/HttpCallContext.php:417
Stack trace:
#0 /[path]/application/libraries/Debugger/Debugger.php(25): Tracy\Debugger::errorHandler()
#1 /[path]/application/libraries/TracyIntegration.php(50): App\Debugger\Debugger::errorHandler()
#2 /[path]/vendor/microsoft/azure-storage-common/src/Common/Internal/Http/HttpCallContext.php(417): _error_handler()
#3 /[path]/vendor/microsoft/azure-storage-table/src/Table/TableRestProxy.php(355): MicrosoftAzure\Storage\Common\Internal\Http\HttpCallContext->__toString()
#4 /[path]/vendor/microsoft/azure-storage-table/src/Table/TableRestProxy.php(1615): MicrosoftAzure\Storage\Table\TableRestProxy->createBatchRequestBody()
#5 /[path]/application/libraries/Report/Processor.php(312): MicrosoftAzure\Storage\Table\TableRestProxy->batchAsync()
#6 /[path]/application/libraries/Report/Processor.php(331): App\Report\Processor->batchPromisesGenerator()
#7 /[path]/application/controllers/Process.php(423): App\Report\Processor->processBatch()
#8 /[path]/system/core/CodeIgniter.php(532): Process->dmarc()
#9 /[path]/public/index.php(324): require_once('/media/snafu-ht...')
#10 {main}

Steps to reproduce the issue?

Any Table Storage batchAsync call will probably fail. In plain PHP: https://3v4l.org/ZTlu5

Have you found a mitigation/solution?

Yes, $uri should be checked if it's null first, I'll prepare a PR (#208).

@ecourtial
Copy link

Opened a PR to try to fix it.
I think this library would need a complete CI against all the supported PHP version.

@spaze
Copy link
Contributor Author

spaze commented Jan 16, 2020

Opened a PR to try to fix it.
I think this library would need a complete CI against all the supported PHP version.

The fix is in #208. Yours will fail when $uri is null: https://3v4l.org/FPWgD

@spaze
Copy link
Contributor Author

spaze commented Feb 6, 2020

Hi folks, do you have an idea when PHP 7.4 will be supported (when the fix for this will be merged to master and released)? Thanks!

@ScottHelme
Copy link

Hey everyone, looping back on this. We're still blocked on an update to PHP 7.4 on this issue. Any update on when this will be fixed?

@katmsft
Copy link
Member

katmsft commented May 31, 2020

We are currently preparing for the next release within a month. Please stay tuned.

@katmsft katmsft self-assigned this May 31, 2020
@spaze
Copy link
Contributor Author

spaze commented Jul 8, 2020

@katmsft Please escalate this issue, thanks.

@katmsft
Copy link
Member

katmsft commented Jul 15, 2020

We will be having quarterly releases starting from Aug. Please stay tuned.

@spaze
Copy link
Contributor Author

spaze commented Jul 15, 2020

We will be having quarterly releases starting from Aug. Please stay tuned.

That sounds good, thank you. Looking forward to it!

@spaze
Copy link
Contributor Author

spaze commented Aug 28, 2020

Thank you for the new release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants