PHP Code Specification (8) _php Tutorial

Source: Internet
Author: User
4.5 Documentation Comments

Document comments describe PHP classes, constructors, methods, and fields (field). Each document comment is placed in the comment delimiter/**...*/, and a comment corresponds to a class or member. The comment should precede the declaration:


/**
* Description of some of this class ...
*/
Class Example {...

Note that the top-level (top-level) class is not indented, and its members are indented. The first line (/**) of the document comment describing the class does not need to be indented, and subsequent document comments indent each line by 1 cells (the asterisk is aligned vertically). Members, including constructors, indent the first line of their document comments by 4, and each line is then indented by 5 cells.

If you want to give information about a class, variable, or method that is not suitable for writing in a document, you can use implementation block annotations (see 5.1.1) or a single-line comment immediately following the declaration (see 5.1.2). For example, the details of a class implementation should be placed in the implementation block comments immediately following the class declaration, rather than in the document comments.

Document comments cannot be placed in a definition block of a method or constructor, because the program will associate the first declaration that is located after the document comment.


http://www.bkjia.com/PHPjc/532596.html www.bkjia.com true http://www.bkjia.com/PHPjc/532596.html techarticle 4.5 Documentation Comments Document comments describe PHP classes, constructors, methods, and fields (field). Each document comment is placed in the comment delimiter/**...*/, and a comment corresponds to a class ...

  • 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.