折雨的天空
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
2019-1-9 我好笨


PHP7.3中在switch中使用continue语句会出现如题警告。



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



使用break或者continue 2代替。

发表评论:
昵称

邮件地址 (选填)

个人主页 (选填)

内容