1.2.179. Collect Local Variable Counts¶
This analysis collects the number of local variables used in a method or a function.
The count applies to functions, methods, closures and arrow functions.
Arguments and global variables are not counted. Static variables are.
<?php
function foo($arg) {
global $w;
// This is a local variable
$x = rand(1, 2);
return $x + $arg + $w;
}
?>
1.2.179.1. Connex PHP features¶
1.2.179.1.1. Specs¶
Short name |
Dump/CollectLocalVariableCounts |
Rulesets |
|
Exakat since |
2.1.2 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
Very high |
Available in |