3.2 import statements
The import statement should be in the header of the file and describe the role of the file when introducing the statement. For example:
// Database operations
Require ("db. php ");
Declaration of the 3.3 Class
Annotation of Class 1 Documents (/**...... */) The information to be included in the comment. For more information, see "document comment"
Class 2 Declaration
Annotations for the three types of implementations (/*...... */) If necessary, the comment should contain any information about the entire class, which is not suitable for commenting on the class document.
Class 4 (static) variables are first the public variables of the class, followed by the protection variables, then the variable at the package level (no access modifier, access modifier), and finally the private variables.
5. The instance variables are at the public level first, followed by the protection level, followed by the package level (no access modifier), and finally the private level.
6 Constructor
7. These methods should be grouped by functions, rather than scope or access permissions. For example, a private class method can be placed between two public instance methods. The purpose is to make it easier to read and understand the code.