1.2.213. 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.213.1. Specs

Short name

Constants/ConditionedConstants

Rulesets

All, Appinfo

Exakat since

0.8.4

PHP Version

All

Severity

Time To Fix

Precision

Very high

Features

conditioned

Available in

Entreprise Edition, Exakat Cloud