What is the "@" Symbol for in Comments? What is the "@" Symbol for in Comments? wordpress wordpress

What is the "@" Symbol for in Comments?


These are PHPDoc comments. They're intended to be machine-parseable to support automated documentation and IDE code completion.


The previous answers are correct in stating that the @ symbols in source comments are PHPDoc comments. They can additionally be used for something called "annotation" which adds metadata to some element of code and can affect the behavior of an application. It's not officially supported in PHP but it's been under discussion for several years and is in use in the Symfony, Doctrine, and other projects.

An excellent explanation via slideshow (no affiliation with me) of all things PHP and annotation:

http://www.slideshare.net/rdohms/annotations-in-php-they-exist

A generic discussion of the subject of annotation:

http://en.wikipedia.org/wiki/Annotation

An RFC from 2010 regarding the implementation of annotations in PHP:

http://wiki.php.net/rfc/annotations


Such notations serve as a way to create a documentation parser out of comments. So, the first @ could be identified as the version, the second as the arguments and so on.