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代替。
2019-01-09
18
0
PHP7.3中在switch中使用continue语句会出现如题警告。
while ($foo) { switch ($bar) { case "baz": continue; // In PHP: Behaves like "break;" // In C: Behaves like "continue 2;" } }
本文作者: 折雨的天空
原文链接: Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
版权声明: 本站所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
免责声明: 文中如涉及第三方资源,均来自互联网,仅供学习研究,禁止商业使用,如有侵权,联系我们24小时内删除!