Commit Graph

3 Commits

Author SHA1 Message Date
Sergey Biryukov
3deded1729 General: PHP 7.3 throws an E_WARNING when using continue to target a switch.
Applying continue to a switch is equivalent to using break and quite possibly, a continue targeting a higher level control structure is actually intended.

To target the higher level control structure, a numeric argument has to be passed to continue. This fixes two cases in WordPress Core where this is currently happening.

See: https://github.com/php/php-src/pull/3364
See: https://wiki.php.net/rfc/continue_on_switch_deprecation

Props jrf.
Merges [43653] to the 5.0 branch.
Fixes #44543.
Built from https://develop.svn.wordpress.org/branches/5.0@43746


git-svn-id: http://core.svn.wordpress.org/branches/5.0@43575 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2018-10-18 03:42:27 +00:00
Gary Pendergast
4f48c60803 I18N: Fix a PHP error introduced in [41722].
PHP 5.2 and 5.3 don't support short array syntax, Ryan.

Fixes #41562.


Built from https://develop.svn.wordpress.org/trunk@41723


git-svn-id: http://core.svn.wordpress.org/trunk@41557 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 02:12:46 +00:00
Gary Pendergast
0a3b7d8e31 I18N: Introduce the Plural_Forms class.
Historically, we've evaluated the plural forms for each language using `create_function()`. This is being deprecated in PHP 7.2, so needs to be replaced.

The `Plural_Forms` class parses the `Plural-Forms` header from the PO file, and internally caches the result of all subsequent plural form tests, allowing it to match the performance of the existing code.

Props rmccue.
Fixes #41562.


Built from https://develop.svn.wordpress.org/trunk@41722


git-svn-id: http://core.svn.wordpress.org/trunk@41556 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-10-04 01:30:46 +00:00