Closed simoheinonen closed 2 years ago
👋 @simoheinonen can you provide a little context behind this PR? What were you attempting to do when you received this error?
@hollabaq86 I can attempt to answer for OP since I'm having the same issue:
On php 7.x, accessing an invalid index on an array returns null
. In php 8.x, accessing an invalid index on an array still returns null
but also outputs a warning.
You can test this on any php online | sandbox, by selecting php 7.x and then php 8.x with the following code:
$arr = [];
var_dump(isset($arr[0]));
var_dump($arr[0]); // outputs null in both php 7.x and php 8.x but a warning is emitted in php 8.x
The PR that @simoheinonen fixes this warning from ever being emitted without changing the result between php versions and I look forward to this getting merged in soon.
Hi @simoheinonen, thanks for the PR! We noticed there isn't any test coverage for this change, could I trouble you to add that? Please could you also mark the changelog entry as unreleased?
…/lib/Braintree/ResourceCollection.php on line 58
Summary
Checklist