Repository navigation
4.x: Fix PHP 7.4+ and 8.5 deprecation warnings - #310
bealinawaz wants to merge 1 commit into
Conversation
|
Ok, thank you. |
|
Thanks! I'm not a WP-CLI maintainer, so this is only what I can see in their repo. No, it doesn't need PHP < 7.2 anymore: WP-CLI requires PHP 7.2.24 or newer. PHP was the reason for years (wp-cli/i18n-command#303), and once the minimum went up there was an attempt to move to v5 in wp-cli/i18n-command#443 and its follow-up #465. Both were closed without merging in December 2025. #443 says v5 has a lot of changes and doesn't ship some things the command uses, such as Jed support and the So it's still on |
|
Maintainer here 👋 Maybe it's time to attempt the migration again... Las time I tried it indeed seemed like too big of a lift, and the lack of |
|
Quick update: Making some progress in github.com/wp-cli/i18n-command/pull/522 Some observed bugs/blockers so far:
|
The 4.x line is still used by WP-CLI's
i18ncommand (gettext/gettext ^4.8), and on current PHP versionswp i18n make-potprints these deprecations from it:Merge.php:(boolean)is deprecated in PHP 8.5;(bool)is identical.PhpCode.php,\u{...}escapes:hexdec()was given the braces too ({1f600}). PHP ignored them, so the value was right, but it has warned since PHP 7.4. WordPress core triggers this onmake-pot(e.g."\u{2022}"and"\u{FFFD}"in wp-includes).PhpCode.php, octal escapes\400–\777:chr()wrapped values above 255, which PHP 8.5 deprecates.% 256gives the same byte, which also matches PHP's own"\400" === "\0".The output is unchanged, and the code still works on PHP 5.4. Tested on PHP 8.5.12 with WP-CLI nightly running this branch with and without the patch:
make-poton WordPress core's wp-includes (8,028 strings), on five plugins, with--merge, andupdate-poon a translated PO file. The generated files are byte-identical apart from the creation date, and the deprecations are gone.php -lreports nothing else insrc/.