PHP programming specifications! Notes

Source: Internet
Author: User
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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.