Previous Up Next
@uses phpDocumentor tags @version

@var

Document the data type of a class variable

Description

You may use the @var tag to document the data type of class variables.

The datatype should be a valid PHP type (int, string, bool, etc), a class name for the type of object, or simply "mixed". phpDocumentor will display the optional description unmodified, and defaults to "mixed" if the datatype is not present

Example

Here's an example:

  1. class class1
  2. {
  3.    /**
  4.     * example of documenting a variable's type
  5.     * @var string 
  6.     */
  7.    var $variable;
  8.    /**
  9.     * example of documenting a variable's type
  10.     * @var string contains class1 information
  11.     */
  12.    var $variable_with_desc;
  13.    /**
  14.     * this variable is documented as type "mixed" since no @var tag is present
  15.     */
  16.    var $mixed_variable;
  17. }

Previous Up Next
@uses phpDocumentor tags @version

Documentation generated on Mon, 05 Dec 2011 21:18:41 -0600 by phpDocumentor 1.4.4