Home > Backend Development > PHP Tutorial > PHP coding specifications (3)_PHP tutorial

PHP coding specifications (3)_PHP tutorial

WBOY
Release: 2016-07-13 17:20:24
Original
746 people have browsed it

3.2 Introduction Statement

The import statement should be located at the head of the file and explain the role of the imported file when introducing it. For example:

//Database operation class
require( “db.php” );
3.3 Class declaration

1 Class documentation comment (/**……*/) For information that needs to be included in this comment, see "Documentation Comments"
2 Class declaration
3 Class implementation comment (/**/) If necessary, this comment should contain any information about the entire class that is not suitable as a class documentation comment.
4 Class (static) variables First are the public variables of the class, then are the protected variables, then are the package-level variables (without access modifier, access modifier), and finally are the private variables.
5 Instance variables are first at the public level, then at the protection level, then at the package level (without access modifiers), and finally at the private level.
6 Constructors
7 Methods These methods should be grouped by functionality, not scope or access rights. For example, a private class method can be placed between two public instance methods. Its purpose is to make it easier to read and understand the code


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/532601.htmlTechArticle3.2 Introduction statement The introduction statement should be located at the head of the file, and explain the role of the imported file when introducing it. For example: //Database operation class require( “db.php” ); 3.3 Class declaration 1 class...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template