Comment Specification for PHP

Source: Internet
Author: User

@access

Scope of Use: Class,function,var,define,module

This tag is used to indicate access rights for keywords: private, public, or proteced

@author

Specify the author

@copyright

Scope of Use: Class,function,var,define,module,use

Specify copyright information

@deprecated

Scope of Use: Class,function,var,define,module,constent,global,include

Indicate unused or obsolete keywords

@example

The tag is used to parse a piece of file content and highlight them. Phpdoc will attempt to read the contents of the file from the file path that is marked

@const

Scope of Use: Define

Constants used to indicate define in PHP

@final

Scope of Use: Class,function,var

Indicates that the keyword is a final class, method, property, and prohibits derivation and modification.

@filesource

Similar to example, except that the tag will directly read the contents of the currently parsed PHP file and display it.

@global

Indicates the global variables referenced in this function

@ingore

Used to ignore the specified keyword in the document

@license

Equivalent to the <A> in the HTML tag, first the URL, and then the content to be displayed

For example <a href= "http://www.baidu.com" > Baidu </a>

Can write @license http://www.baidu.com Baidu

@link

Similar to license

But you can also refer to any one of the keywords in the document by link.

@name

Specifies an alias for the keyword.

@package

Scope of Use: page-level-> define,function,include

Class-Level->class,var,methods

Used to logically divide one or several keywords into a group.

@abstrcut

Indicates that the current class is an abstract class

@param

Indicates the parameters of a function

@return

Indicates the return point of a method or function

@static

Indicates that the closed word is static.

@var

Indicate variable type

@version

Indicate version information

@todo

Identify areas that should be improved or not implemented

@throws

Indicates an error exception that may be thrown by this function, which is most likely to occur

As mentioned above, ordinary document tag tags must be at the beginning of each line at the @ mark, in addition, there is a tag called inline tag, expressed in {@}, specifically include the following:

{@link}

Use the same @link

{@source}

Display the contents of a function or method

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.