[wp-trac] [WordPress Trac] #64634: Build/Tools: Update PHPCompatibilityWP to 3.0.0-alpha2
WordPress Trac
noreply at wordpress.org
Fri Feb 13 13:50:08 UTC 2026
#64634: Build/Tools: Update PHPCompatibilityWP to 3.0.0-alpha2
------------------------------+--------------------------------
Reporter: rodrigosprimo | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: | Focuses: php-compatibility
------------------------------+--------------------------------
Comment (by rodrigosprimo):
After posting the ticket, I noticed a few things that could be corrected
or that I missed. Adding them here as a comment, as it seems I don't have
permission to edit the ticket description.
**Corrections and clarifications:**
1. The description says //"The alpha status reflects that sniff coverage
for all new PHP syntaxes isn't yet complete."// That's not accurate. The
alpha status is about preventing false positives and false negatives on
new PHP syntaxes in pre-existing sniffs, not about adding coverage for new
syntaxes.
2. Point 5 in the description says //"PHPCompatibility 10.0 renamed error
codes"//. To clarify: the error codes weren't explicitly renamed.
PHPCompatibility 10.0 adds data about functions that were removed in PHP
8+. Functions that were previously only known to be deprecated now
correctly show as both deprecated and removed, which changes the error
code from `Deprecated` to `DeprecatedRemoved`.
**Additions:**
1. Another reason to update is that PHPCompatibility 10.0 fixes bugs in
pre-existing sniffs, some of which affect WP Core. For example, there is
currently a [https://github.com/WordPress/wordpress-
develop/blob/7b3ea1a9a970cc8ec6d45e22a9411f45b9f7aa21/phpcompat.xml.dist#L117-L123
workaround in `phpcompat.xml.dist`] to exclude a false positive for
`$this` in static closures in `script-loader.php` (see
[https://github.com/PHPCompatibility/PHPCompatibility/issues/1481
PHPCompatibility#1481]). This bug is fixed in 10.0.0-alpha1, so the
workaround can be removed with this update.
2. I forgot to mention and include a link to the
[https://github.com/PHPCompatibility/PHPCompatibility/wiki/Upgrading-to-
PHPCompatibility-10.0 PHPCompatibility 10.0 upgrade guide], which is a
useful reference for this update.
3. Regarding the Composer stability settings: using `"minimum-stability":
"dev"` and `"prefer-stable": true` (which affects Composer's resolution
behavior for the entire project) is one of the options. Another approach
is to explicitly require PHPCompatibilityWP's own dependencies in
`require-dev`:
{{{
"phpcompatibility/phpcompatibility-wp": "3.0.0-alpha2",
"phpcompatibility/php-compatibility": "10.0.0-alpha2",
"phpcompatibility/phpcompatibility-paragonie": "2.0.0-alpha2"
}}}
This way, only the PHPCompatibility packages are allowed to use unstable
versions, without affecting other dependencies.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/64634#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list