1.2.580. Init Then Update¶
This is a structure where the variable is initialized in the main sequence of the code, then adapted to another value in a subsequent if structure.
This analysis reports such structures, based on assignation of constant values in the initial statement.
<?php
$a = 1;
if ($b === 2) {
$a = 2;
}
?>
1.2.580.1. Connex PHP features¶
1.2.580.1.1. Specs¶
Short name |
Structures/InitThenIf |
Rulesets |
|
Exakat since |
2.5.2 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Quick (30 mins) |
Precision |
Medium |
Available in |