phpDocumentor phpDocumentor
[ class tree: phpDocumentor ] [ index: phpDocumentor ] [ all elements ]
Prev Next

@staticvar

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

by Gregory Beaver
Tag Documentation written by cellog@php.net
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. }

Prev Up Next
@static phpDocumentor tags @subpackage

Documentation generated on Tue, 06 Dec 2011 07:15:53 -0600 by phpDocumentor 1.4.4