Support PHP 8.2 and work around reporting dynamic properties#1096
Merged
clue merged 2 commits intoratchetphp:0.4.xfrom May 16, 2025
Merged
Support PHP 8.2 and work around reporting dynamic properties#1096clue merged 2 commits intoratchetphp:0.4.xfrom
clue merged 2 commits intoratchetphp:0.4.xfrom
Conversation
Member
Author
|
Let's get this shipped, so we can focus on newer PHP versions in a follow-up |
This was referenced May 16, 2025
This was referenced May 30, 2025
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changeset adds support for PHP 8.2 and works around reporting any dynamic properties. This is part 7 of reviving Ratchet as discussed in #1054, unblocking more future progress.
With these changes applied, the existing test suite recently updated with #1094, #1093 and #1092 now works fine on PHP 8.2 at last. Once merged, I'll use this as a starting point to add newer PHP 8.3+ version support as discussed in #1003 and elsewhere.
Together with the recent Symfony 6 improvements from #1095, this PR also unblocks upcoming support for Symfony 7 (which requires PHP 8.2+). Once both are merged, I'll use this as a starting point to add newer Symfony 7 version support as discussed in #1045 and elsewhere.
Note that this employs a number of workarounds to support avoid raising deprecation notices when assigning dynamic properties on PHP 8.2+. Most notably, this makes use of the
#[\AllowDynamicProperties]attribute where needed, plus a custom error handler ignoring notices where dynamic properties are used on vendor code. While this isn't exactly perfect, I think it's good enough to get this working on newer PHP versions again without applying a major refactoring and introducing any BC breaks. Future PRs to improve this very much welcome.Overall, this still requires a massive effort. If you want to support this project, please consider sponsoring @reactphp ❤️
Builds on top of #1094, #1093, #1092, #1091 and #1088, one step closer to reviving Ratchet as discussed in #1054