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

Support PHP 8.1 for sentry-php 2.x #1264

Closed
wants to merge 4 commits into from
Closed

Conversation

annuh
Copy link
Contributor

@annuh annuh commented Nov 17, 2021

We can't update to sentry-php 3.x, because of this issue: getsentry/sentry-symfony#421.

With this change we can still use Sentry and upgrade to the latest PHP 8.1. 🙂

Fixes:

Fatal error:  During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Sentry\Context\Context::offsetGet($offset) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/sentry/sentry/src/Context/Context.php:152

(follow-up from #1247)

@annuh annuh marked this pull request as ready for review November 17, 2021 12:01
@ste93cry
Copy link
Collaborator

As written in #1247 (comment), not supporting PHP 8 on the 2.x version was a deliberate choice because we don't have the resources to maintain that SDK if issues arise due to incompatibility or other things like that. Moreover, we did some changes in error handling to support PHP8 and we didn't backport them to older versions, so while it may seem that adding a few attributes here and there will make things work, there are other issues hidden elsewhere that will hit you in the long run. For this reason, I'm going to close the issue. I've left a comment on the referenced issue in the getsentry/sentry-symfony repo with a workaround that I think may work (not tested though)

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

Successfully merging this pull request may close these issues.

None yet

2 participants