PHP Development Technical Specification ____php

Source: Internet
Author: User

1. Lenient constraint, no more than 130 columns per line

2. The class name is composed of English, the first letter is capitalized, is separated by the underline, the format: THIS_CLASS_DO

3. The interface class is Interface by the suffix, such as: Log_adapter_interface

4. File name, all lowercase, multiple words with the underline separated

5. Made up of English without numbers and underscores, camel law (beginning lowercase, other first letter capital)

6. The object's accessor is prefixed by get,set

7. Method involves design pattern, the method name as far as possible contains design pattern names

8. Variable naming also follows the camel rule and does not advocate digital

9. For Protected,private class member variables, the following underscore begins

10. Functions and variables to maintain a certain program of detail and verbose, to have practical significance, in addition to temporary variables

11. Constants use letters, numbers, underscores, and all uppercase letters

12. Do not promote global functions and global constants

13. Pure string Assignment in single quotes, such as single quotes or variables with double quotes

14. Note Blank, equal sign, semicolon, connection number, etc.

15. The connection number to the string does not leave blank lattice, to the variable blank

16. Long line split, to fill with space, so that the row is consistent and readable, without affecting the next line of recognition

17. If the elements in the array after the comma plus space to enhance readability

18. For the number of group leader elements, each branch, the elements are aligned in columns

19. Curly braces in the next line of the class name

20. Each class has an annotation document block that adheres to the Phpdocumentor standard

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.