1.2.1295. Unused Constants¶
Those constants are defined in the code but never used. Defining unused constants slow down the application, as they are executed and stored in PHP hashtables. It is recommended to comment them out, and only define them when it is necessary.
<?php
// const-defined constant
const USED_CONSTANT = 0;
const UNUSED_CONSTANT = 1 + USED_CONSTANT;
// define-defined constant
define('ANOTHER_UNUSED_CONSTANT', 3);
?>
1.2.1295.1. Connex PHP features¶
1.2.1295.1.1. Suggestions¶
Make use of the constant
Remove the constant
1.2.1295.1.2. Specs¶
Short name |
Constants/UnusedConstants |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Instant (5 mins) |
Precision |
High |
Available in |