php编码规范(16)

6.8 switch语句

一个switch语句应该具有如下格式:switch (condition) {  case abc:   /* falls through */    statements;  case def:   statements;   break;

  case xyz:    statements;    break;

  default:    statements;    break;}每当一个case顺着往下执行时(因为没有break语句),通常应在break语句的位置添加注释。上面的示例代码中就包含注释/* falls through */。

http://www.bkjia.com/phpjc/532588.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/532588.htmltecharticle6.8 switch语句 一个switch语句应该具有如下格式: switch (condition) { case abc: /* falls through */ statements; case def: statements; break; case xyz: statements; bre…

Posted in 未分类

发表评论