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”?


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM