Previous Up Next
@static phpDocumentor tags @subpackage

@staticvar

Document a static variable's use in a function/method

Gregory Beaver
Tag Documentation written by [email protected]
Copyright 2002, Gregory Beaver
(phpDocumentor 1.1+)
@staticvar datatype description

Description

Datatype should be a valid PHP type or "mixed."

phpDocumentor will display the optional description unmodified

Example

Here's an example:

  1. /**
  2.  * example of basic @staticvar usage in a function
  3.  * @staticvar integer used to calculate the division tables
  4.  * @staticvar array $bar is used to make me happy.  Note that $bar is part of the description
  5.  * @param bool $baz 
  6.  * @return mixed 
  7.  */
  8. function function1($baz)
  9. {
  10.    static $foo 6,$bar array();
  11.    // note that this works as:
  12.    // static $foo = 6;
  13.    // static $bar = array();
  14.    if ($baz)
  15.    {
  16.       $a 5;
  17.    else
  18.    {
  19.       $a array(1,4);
  20.    }
  21.    return $a;
  22. }

Previous Up Next
@static phpDocumentor tags @subpackage

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