Update: Unset variable set by reference after a foreach loop.#55261
Conversation
|
This pull request has changed or added PHP files. Please confirm whether these changes need to be synced to WordPress Core, and therefore featured in the next release of WordPress. If so, it is recommended to create a new Trac ticket and submit a pull request to the WordPress Core Github repository soon after this pull request is merged. If you're unsure, you can always ask for help in the #core-editor channel in WordPress Slack. Thank you! ❤️ View changed files❔ lib/class-wp-theme-json-gutenberg.php |
|
Flaky tests detected in dd8acf6. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6483982542
|
|
@jorgefilipecosta I've started the sync process for this change in:
I'd be grateful for your review. |
In PHP it is a good practice to unset $value if it was created by reference in a foreach loop, as the reference is still valid outside the loop, and this avoids accidental bugs.