1.2.938. PHP Alternative Syntax¶
This rule identifies the usage of alternative syntax in the code, for if then, switch, while, for and foreach.
Alternative syntax is another way to write the same expression. Alternative syntax is less popular than the normal one, and associated with older coding practices.
<?php
// Normal syntax
if ($a == 1) {
print $a;
}
// Alternative syntax : identical to the previous one.
if ($a == 1) :
print $a;
endif;
?>
See also Alternative syntax.
1.2.938.1. Connex PHP features¶
1.2.938.1.1. Specs¶
Short name |
Php/AlternativeSyntax |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
|
Time To Fix |
|
Precision |
Very high |
Available in |