在 php 7.3 中 switch 語句中使用 continue
在 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