General: PHP7.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. Fixes #44543. git-svn-id: https://develop.svn.wordpress.org/trunk@43653 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
fb2699f28d
commit
6604782cd9
@ -207,7 +207,7 @@ class Plural_Forms {
|
|||||||
$span = strspn( $str, self::NUM_CHARS, $pos );
|
$span = strspn( $str, self::NUM_CHARS, $pos );
|
||||||
$output[] = array( 'value', intval( substr( $str, $pos, $span ) ) );
|
$output[] = array( 'value', intval( substr( $str, $pos, $span ) ) );
|
||||||
$pos += $span;
|
$pos += $span;
|
||||||
continue;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Exception( sprintf( 'Unknown symbol "%s"', $next ) );
|
throw new Exception( sprintf( 'Unknown symbol "%s"', $next ) );
|
||||||
|
@ -498,7 +498,7 @@ function benchmark_pcre_backtracking( $pattern, $subject, $strategy ) {
|
|||||||
case PREG_NO_ERROR:
|
case PREG_NO_ERROR:
|
||||||
return $i;
|
return $i;
|
||||||
case PREG_BACKTRACK_LIMIT_ERROR:
|
case PREG_BACKTRACK_LIMIT_ERROR:
|
||||||
continue;
|
break;
|
||||||
case PREG_RECURSION_LIMIT_ERROR:
|
case PREG_RECURSION_LIMIT_ERROR:
|
||||||
trigger_error( 'PCRE recursion limit encountered before backtrack limit.' );
|
trigger_error( 'PCRE recursion limit encountered before backtrack limit.' );
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user