To get the most from your documentation efforts, it is important to understand the differences between different types of comments. Some types of comments just include information for programmers, and other types actually store their content with the programís data.

Types of Comments

PHP has several types of comments. Single-line comments are declared like this:

//This is an inline comment
Multiline comments have the following form:
This is a multiline comment and
may span many lines
A third form is known as a doccomment, which is declared like this:
This is a doccomment, which is also often
called a docblock
The two latter forms might look similar, but they have different parsing implications to PHP. The first form is just human-readable information that is not meaningful to PHP. The second form does something extra: it stores the data of the comment along with the program code, and this data may be used by other applications to get more information about how they should interact with your program. Letís take a closer look at how doccomments work.