1.2.508. Global Usage¶
List usage of globals variables, with global keywords or direct access to $GLOBALS. It is recommended to avoid using global variables, at it makes it very difficult to track changes in values across the whole application.
<?php
$a = 1; /* global scope */
function test()
{
echo $a; /* reference to local scope variable */
}
test();
?>
See also Variable scope.
1.2.508.1. Connex PHP features¶
1.2.508.1.1. Specs¶
Short name |
Structures/GlobalUsage |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Slow (1 hour) |
Precision |
Very high |
ClearPHP |
|
Available in |