Annotations are important in the process of writing code, and good annotations make your code easier to read, so be sure to note the specification when writing code.
There are several common annotation methods in PHP:
1. File header comments, introduction of file name, function and author version number and other information
/* * * * * * File name * * *document function. * @author Alvin Author * @version 1.0 version number
2. Function comment, function, parameter introduction and return type
*/* * The meaning of the function description * * @access public * @param mixed $arg 1 The description of parameter one * @param mixed $arg 2 parameter two description * @param mixed $mixed This is a Mixed type * @return array return type */
3. Class comment, class name and introduction
* * *Class Description * * Class details (optional.) )。 * @author Alvin Author * @version 1.0 version number
4. Multi-line annotations
/* PHP Comment Syntax This is a multi-line comment.
5. Single-line Comment
Quantity N, this is a single-line comment
PHP Annotation Specification