1.2.1150. Static Variable In Namespace¶
<?php
namespace A {
// Static has no value here.
static $a = 1;
function foo() {
// One useful static variable
static $static = 2;
}
}
?>
1.2.1150.1. Suggestions¶
Remove the ‘static’ keyword in the code
1.2.1150.2. Specs¶
Short name |
Variables/StaticVariableInNamespace |
Rulesets |
|
Exakat since |
2.6.1 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
Very high |
Features |
static-variable, namespace |
Available in |