[wp-trac] [WordPress Trac] #44543: PHP 7.3 compatibility: using `continue` in `switch` statements

WordPress Trac noreply at wordpress.org
Sun Sep 23 22:49:05 UTC 2018


#44543: PHP 7.3 compatibility: using `continue` in `switch` statements
------------------------------+---------------------
 Reporter:  jrf               |       Owner:  jrf
     Type:  defect (bug)      |      Status:  closed
 Priority:  normal            |   Milestone:  4.9.9
Component:  General           |     Version:  trunk
 Severity:  normal            |  Resolution:  fixed
 Keywords:  has-patch commit  |     Focuses:
------------------------------+---------------------
Changes (by jorbin):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"43653" 43653]:
 {{{
 #!CommitTicketReference repository="" revision="43653"
 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.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44543#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list