1.2.1301. Unused Label¶
Some labels have been defined in the code, but they are not used. They may be removed as they are dead code.
There is no analysis for undefined goto call, as PHP checks that goto has a destination label at compile time :
<?php
$a = 0;
A:
++$a;
// A loop. A: is used
if ($a < 10) { goto A; }
// B is never called explicitly. This is useless.
B:
?>
See also Goto.
1.2.1301.1. Connex PHP features¶
1.2.1301.1.1. Suggestions¶
Remove the unused label
Add a goto call to this label
Check for spelling mistakes
Check that it is not a coding typo, like a raw
http://www.php.net
, left in the code (It is actually valid PHP code)
1.2.1301.1.2. Specs¶
Short name |
Structures/UnusedLabel |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
High |
Available in |