PHP Fatal error: ‘continue’ not in the ‘loop’ or ‘switch’ context

After upgrade PHP to 7.2, I got error message like PHP Fatal error: ‘continue’ not in the ‘loop’ or ‘switch’ context. How can I solve this issue?

For the early PHP version, PHP will not throw an error message, if you are using “continue” outside a “for, foreach or switch”. For PHP 7.0 or later version, “continue” is not longer permitted outside a “for, foreach or switch” and gives a fatal error. 

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments