ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
在语言结构(if,else,while,switch,for,foreach)中和类(class)、函数(function)、方法(method)中,左、右大括号必须单独占一行,与其声明处在相同的缩进级别。 例如: /* These are all wrong. */ if (condition) { while (condition2) { ... } } else { ... } /* These are right. */ if (condition) { while (condition2) { ... } } else { ... } /* These are all wrong. */ for ($i = 0;$i < $size;$i++) { ... } /* These are right. */ for ($i = 0;$i < $size;$i++) { ... } /* These are all wrong. */ while (condition) { ... } /* These are right. */ while (condition) { ... } /* These are all wrong. */ switch (condition) { case: 1 ... default: ... } /* These are right. */ switch (condition) { case: 1 ... default: ... } /* These are right. */ function do_stuff() { ... } /* These are right. */ class some_class { function a_method() { ... } }