Search code examples
phpspecial-charactersphpdocdocblocks

symbols "#@+" in PHP comments


I have found some special symbols "#@+" and "#@-" in the comments/documentation in ZF1. Example:

/**#@+
 * @access protected
 */

(https://github.com/zendframework/zf1/blob/master/library/Zend/Mail.php#L54)

I have seen before in another different repositories.

What do these mean?


Solution

  • They are PHP DocBlock templates declarations. There should be an ending tag /**#@-*/ in the file as well. It allows you to specify the same documentation across multiple properties, methods or constants.

    A better explaination with examples can be found here: http://codingexplained.com/coding/php/how-to-use-docblock-templates-in-phpdoc