1.2.1426. Variable Is A Local Constant¶
A variable that is written once, then never modified : it behaves like a constant. Some other rule may take advantage of this.
<?php
function foo() {
$localConstant = 'Hello';
echo $localConstant;
$variable = 'Hello, ';
$variable .= date('r');
echo $variable;
}
?>
1.2.1426.1. Specs¶
Short name |
Variables/IsLocalConstant |
Rulesets |
|
Exakat since |
2.3.3 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
High |
Available in |