Support » Fixing WordPress » Warning: “continue” targeting switch is equivalent to “break”

  • QuizCow

    (@quizcow)


    Upgraded from PHP 5.6 to 7.3 and I now have two errors that display in the header on my homepage ONLY:

    Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /home/gobuddy2/public_html/quizcow/wp-includes/pomo/plural-forms.php on line 210

    Warning: Cannot modify header information – headers already sent by (output started at /home/gobuddy2/public_html/quizcow/wp-includes/pomo/plural-forms.php:210) in /home/gobuddy2/public_html/quizcow/wp-content/plugins/sg-cachepress/class-sg-cachepress.php on line 315

    I’ve tried downgrading back to PHP 5.6 and then 7.2, but no change. Any help appreciated.

    Thanks

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • QuizCow

    (@quizcow)

    Forgot to mention I’m running WordPress 4.9.8

    Moderator Steve Stern

    (@sterndata)

    Support Team Volunteer

    I recommend asking at https://wordpress.org/support/plugin/sg-cachepress#new-post so the plugin’s developers and support community can help you with this.

    Note that these are warnings,not fatal errors, Make sure you have WP_DEBUG set to false in wp-config.php.

    QuizCow

    (@quizcow)

    Just posted it there. Thanks!

    Moderator Steve Stern

    (@sterndata)

    Support Team Volunteer

    I just saw another instance of this error. 7.3 compatibility is part of WP 5.x, I believe.

    BackuPs

    (@backups)

    just open the files in a ascii editor like notepad++ by ftp goto the corresponding lines as mentioned in the error and change

    continue; into continue 2;

    It is really as easy as that.

    https://stackoverflow.com/questions/26431066/continue-2-and-break-in-switch-statement

    • This reply was modified 12 months ago by BackuPs.

    No, you should NEVER modify core files @backups.

    Besides, using ‘continue 2’ is very different than using ‘continue’. If it was coded using continue, it should be left as continue until the developer decides what it should actually be changed to – it could be ‘break’ or it could be ‘continue 2’. If you get the wrong one, the logic will change and the site could break in unexpected ways.

    @quizcow you can safely ignore the warning; make sure you have visible debug messages turned off by setting define(‘WP_DEBUG_DISPLAY’, ‘false’);

    When WordPress or the plugin has an update it will resolve the warning.

    I am facing the same warnings and my website is broken badly.
    @robrecord Can you please guide how I can recover my website.

    It caused by PHP version. The problem appears when I switch from PHP 5.6 to PHP 7.3.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Warning: “continue” targeting switch is equivalent to “break”’ is closed to new replies.