Previous | Up | Next |
@since | phpDocumentor tags | @staticvar |
Use the @static tag to declare a variable or method to be static. Static elements can be called without reference to an instantiated class object, as in class::variable and class::method().
Here's an example:
Just using the static keyword in your code is enough for PhpDocumentor on PHP5 to recognize static variables and methods, and PhpDocumentor will mark them as static.
However, using the static tag will also result in PhpDocumentor marking the variable or method as static, even if the PHP code does not use the static keyword. So, using the tag but not the keyword actually means your code behavior will not match your API doc... so handle with care. The good news is that using both the keyword and the tag will not result in a double "static" in the resulting doc.
Ideally, the static keyword in your code is sufficient for the resulting docs to show your members are static. This tag appears to be a "helpful" tag for use in PHP4 code, allowing you to hint that you want the member to be treated as static, even if PHP4 doesn't have the ability to make it act that way. Most likely, you'll use this tag as a reminder that your intention with this member, once you move the code from PHP4 to PHP5, will be for that member to be static.
Previous | Up | Next |
@since | phpDocumentor tags | @staticvar |
Documentation generated on Mon, 05 Dec 2011 20:55:54 -0600 by phpDocumentor 1.4.4