WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/18/2018 03:41:46 AM (3 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 5.0 branch.
Fixes #44543.

Location:
branches/5.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0

  • branches/5.0/src/wp-includes/pomo/plural-forms.php

    r41723 r43746  
    208208                        $output[] = array( 'value', intval( substr( $str, $pos, $span ) ) );
    209209                        $pos += $span;
    210                         continue;
     210                        break;
    211211                    }
    212212
Note: See TracChangeset for help on using the changeset viewer.