Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
连续2个空行编写代码是一种有效的方法(PSR-2)吗?
例如:
$a = 1; $b = 2;
或者在$a和$b之间总是必须只有一个空行?
是的,这是 PSR-2 标准可以接受的。
该标准指出:
可以添加空行以提高可读性并指示相关的代码块。