Disallows use of super global variables.
Disallows use of variable variables.
Looks for duplicate assignments to a variable.
Looks for unused variables.
Sniff provides the following settings:
ignoreUnusedValuesWhenOnlyKeysAreUsedInForeach
(defaults tofalse
): ignore unused$value
in foreach when only$key
is used
foreach ($values as $key => $value) {
echo $key;
}
Looks for useless variables.