1.2.1152. Static Variables¶
<?php
function foo() {
// static variable
static $count = 0;
echo ++$count;
}
class bar {
// This is not a static variable :
// it is a static property
static $property = 1;
}
?>
See also Using static variables.
1.2.1152.1. Specs¶
Short name |
Variables/StaticVariables |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
Very high |
Features |
static-variable |
Available in |