What is php doc comments?

It is official code documentation form supported by native PHP API. With php doc comments you can document your classes, properties and methods and other things not related to classes. For example:

* @var \user\group
public $group;

PHP fetches this comment section (which begins with /** line and ends with line */) as public $group property documentation. This documentation can be accessed later using php reflection class. There are couple of standard keywords which can be used inside this doc comments. These keywords are used by various php IDEs and by other projects like phpdoc.

More information about accessing doc comments with php can be seen at ReflectionProperty::getDocComment and at ReflectionClass::getDocComment.

For example @var \user\group tells that following property is type of class located in namespace user and called group (\user\group). Unlike regular comments in PHP, php doc comments first line must begin with:


Must be followed with next lines containing special keywords. These lines must begin with:


And php doc comments section must be closed like regular comments section:


Spaces tabs and other things does not matter. Indeed only matters php doc comments comment opening.

db.php uses php doc comments to extract additional informations about properties and classes.

Get more info at http://php.net/manual/en/reflectionclass.getdoccomment.php