Make WordPress Core


Ignore:
Timestamp:
09/24/2018 08:04:56 PM (6 years ago)
Author:
SergeyBiryukov
Message:

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 4.9 branch.
Fixes #44543.

Location:
branches/4.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.9

  • branches/4.9/tests/phpunit/includes/utils.php

    r41289 r43656  
    441441            return $i;
    442442        case PREG_BACKTRACK_LIMIT_ERROR:
    443             continue;
     443            break;
    444444        case PREG_RECURSION_LIMIT_ERROR:
    445445            trigger_error('PCRE recursion limit encountered before backtrack limit.');
Note: See TracChangeset for help on using the changeset viewer.