Move WeakMap initialization to PHP 8.2+#818
Merged
agibson-godaddy merged 3 commits intorelease/6.1.3from Apr 1, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the framework’s Dynamic_Props WeakMap usage to only activate on PHP 8.2+, avoiding fatal errors seen on older/unpatched PHP 8.0.x and 8.1.x when storing order-related dynamic properties.
Changes:
- Switch WeakMap enablement from PHP 8.0+ to PHP 8.2+ in
Dynamic_Props::use_weak_map(). - Update related inline/docs (
@sincetags, comments) to reflect the new PHP 8.2+ threshold. - Add a changelog entry documenting the change.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
woocommerce/payment-gateway/Dynamic_Props.php |
Updates WeakMap gating logic to PHP 8.2+ and adjusts related doc/comments. |
woocommerce/changelog.txt |
Adds a 6.1.3 changelog entry describing the WeakMap threshold change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
agibson-godaddy
added a commit
that referenced
this pull request
Apr 1, 2026
* Version 6.1.3 * Address GH workflow deprecation warnings (#817) * Update action versions * Replace deprecated set-output * Update pull request template (#819) * Move WeakMap initialization to PHP 8.2+ (#818) * Move WeakMap initialization to PHP 8.2+ * Document 8.2 reasoning * Wording tweaks Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Set release date --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Ashley Gibson <99189195+agibson-godaddy@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Summary
This moves the
WeakMapprerequisite from PHP 8.0+ to PHP 8.2+.Story: MWC-19377
Release: #1234 (release PR)
Details
Some customers were running into fatal errors when using older versions of PHP 8.0.x and 8.1.x:
We tracked that back to php/php-src#8995
This is a bug in PHP which has now been resolved in:
The problem is with customers running on those older, unpatched versions of PHP. They run into the fatal error, with no way to fix it.
The dynamic props deprecation warning doesn't kick in until PHP 8.2+ anyway so we've decided to move the activation threshold to PHP 8.2+, which fully resolves the problem.
QA
Before merge