1.2.1298. Unused Global¶
A global keyword is used in a method, yet the variable is not actually used. This makes PHP import values for nothing, or may create interference
<?php
function foo() {
global bar;
return 1;
}
?>
1.2.1298.1. Connex PHP features¶
1.2.1298.1.1. Suggestions¶
Remove the global declaration
Remove the global variable altogether
1.2.1298.1.2. Specs¶
Short name |
Structures/UnusedGlobal |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
Very high |
Examples |
|
Available in |