Vince
Vince

Reputation: 1535

What Do the @ mean inside these comments ?

I am reading some PHP code from someone else and the file is filled comments preceeding each meathod. What does the comment @access and @var mean ?

/**
 * EE Superobject
 *
 * @access      private
 * @var         object
 */
private $EE;

Many Thanks !

Upvotes: 3

Views: 128

Answers (3)

Lâm Tran Duy
Lâm Tran Duy

Reputation: 814

These are PHPDoc tags: http://en.wikipedia.org/wiki/PHPDoc they are used to describe certain properties of a class or function; the documentation is automatically generated from the comments above class/functions.

Upvotes: 0

Luchian Grigore
Luchian Grigore

Reputation: 258618

It's an annotation used by some documentation generating tools to generate said documentation.

Upvotes: 4

Kermit
Kermit

Reputation: 34054

Specifically used by phpDocuemntor to compile documentation.

phpDocumentor tags are very similar to tags for the JavaDoc tool for Sun's Java Programming Language. Tags are only parsed if they are the first thing on a new line of a DocBlock. You may use the @ character freely throughout documents as long as it does not begin a new line. An example:

/**
 * tags demonstration
 * @author this tag is parsed, but this @version tag is ignored
 * @version 1.0 this version tag is parsed
 */

Here is a list of the standard tags:

@access
@author
@copyright
@deprecated
@example
@ignore
@internal
@link
@see
@since
@tutorial
@version
inline {@internal}}
inline {@inheritdoc}
inline {@link}

Upvotes: 1

Related Questions