laravel exele php7.3 "continue" targeting switch is equivalent to "break"

参考链接
phpcms换了一个服务器,提示:

Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”? in /www/wwwroot/site.donglin.sso/phpsso_server/phpcms/libs/classes/db_mysqli.class.php on line 245

查了一下资料,是php版本的问题。

原文:https://www.techsir.com/club/t/78411

在 php 7.3 的 switch 中使用 continue 会出现警告。1 2 3

while ($foo) {
switch ($bar) {
case "baz":
continue; // In PHP: Behaves like "break;"
// In C: Behaves like "continue 2;"
}
}

最好的方式是把 continue 改为 continue 2 或 break

“continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”?

posted @ 2020-02-10 18:08  段佳伟  阅读(912)  评论(0编辑  收藏  举报