1.2.227. Constant Dynamic Creation¶
Dynamic constants are not possible with the const
keyword, though static constant expression allows for a good range of combinations, including conditions.
<?php
$a = range(0, 4);
foreach($array as $i) {
define("A$i", $i);
define("N$i", true);
}
define("C", 5);
?>
See also PHP Constants.
1.2.227.1. Specs¶
Short name |
Constants/DynamicCreation |
Rulesets |
|
Exakat since |
1.6.7 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
High |
Features |
constant |
Available in |