1.2.215. Conditioned Constants¶
This rule indicates when a constant is defined if a condition is met. Several definitions of a global constant are possible in the code: using conditions, it is possible to have only one defined during execution.
<?php
if (time() > 1519629617) {
define('MY_CONST', false);
} else {
define('MY_CONST', time() - 1519629617);
}
?>
1.2.215.1. Connex PHP features¶
1.2.215.1.1. Specs¶
Short name |
Constants/ConditionedConstants |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
|
Time To Fix |
|
Precision |
Very high |
Available in |