Today, I read the PHP programming specifications. In fact, there are still a few obfuscation places, but I have also identified several mistakes I often make. 1. The first line of indentation cannot be tabs, it must be null. I am also empty for indentation, but only two are empty. It should be four empty. I forgot to check the settings in the software. 2. if ($ tiaojian) {} square brackets have a line break problem.
Today, I read the PHP programming specifications. In fact, there are still a few obfuscation places, but I have also identified several mistakes I often make. 1. The first line of indentation cannot be tabs, it must be null. I am also empty for indentation, but only two are empty. It should be four empty. I forgot to check the settings in the software. 2. if ($ tiaojian) {} square brackets have a line break problem.
Today, I specially read the PHP programming specifications. In fact, there are still some obfuscation, but I have also identified several mistakes that I often make.
1. The first line is indented. It cannot be a tab or a space. I am also an indent space, but it is only two spaces. It should be four spaces. I forgot to check the settings in the software.
2. if ($ tiaojian) {} square brackets have many line breaks. Some of the {s at the beginning of the first line are in the same line as if, and some directly break to the second line. This is still confusing. Should it be the same line as if or broken to the second line?
3. Case sensitivity issues. To highlight the problem, I often use case-insensitive combinations. The description of discuz must be in lower case! In this way, it is not easy to remember. Official instructions are not available yet
Note:
1, php specification, official version: http://pear.php.net/manual/ (Chinese manual http://cn2.php.net/manual/zh/index.php)
2, php specification, Chinese Version 1: http://www.cnblogs.com/sink_cup/archive/2011/07/07/php_coding_standard.html(Last modification: 2011-7-13)
3, php specification, Chinese Version 2: http://www.souzz.net/online/php_coding_standard_cn.html(Last modification: 2000-11-16)