1.2.1424. Variable Constants¶
Variable constants are constants whose value is accessed via the function constant(). Otherwise, there is no way to dynamically access a constant (aka, when the developer has the name of the constant as a incoming parameter, and it requires the value of it).
<?php
const A = 'constant_value';
$constant_name = 'A';
$variableConstant = constant($constant_name);
?>
See also constant().
1.2.1424.1. Connex PHP features¶
1.2.1424.1.1. Specs¶
Short name |
Constants/VariableConstant |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
|
Time To Fix |
|
Precision |
Very high |
Available in |