Unused local variable
Reports the variables that are considered unused in the following cases:
The value of the variable is not used anywhere or is overwritten immediately.
The reference stored in the variable is not used anywhere or is overwritten immediately.
Inspection options
Option | Type | Default |
---|---|---|
Enable inspection in global space | Checkbox | false |
Ignore a foreach value inside 'list()' or when a 'foreach' key exists | Checkbox | true |
Ignore variables inside 'list()' | Checkbox | false |
Ignore assignment to 'null' | Checkbox | true |
Ignore variables accessed via 'get_defined_vars()' | Checkbox | true |
Ignore variables before 'include' | Checkbox | true |
Inspection Details | |
---|---|
Available in: | PhpStorm 2023.3, Qodana for PHP 2023.3 |
Plugin: | PHP, 233.SNAPSHOT |
Last modified: 13 July 2023