1.2.858. Non-lowercase Keywords¶
The usual convention is to write PHP keywords (like as
, foreach
, switch
, case
, break
, etc.) all in lowercase.
PHP understands them in lowercase, UPPERCASE or WilD Case, so there is nothing compulsory here. Although, it will look strange to many.
Some keywords are missing from this analysis : extends
, implements
, as
. This is due to the internal engine, which doesn’t keep track of them in its AST representation.
<?php
// usual PHP convention
foreach($array as $element) {
echo $element;
}
// unusual PHP conventions
Foreach($array AS $element) {
eCHo $element;
}
?>
1.2.858.1. Connex PHP features¶
1.2.858.1.1. Suggestions¶
Use lowercase only PHP keywords, except for constants such as __CLASS__.
1.2.858.1.2. Specs¶
Short name |
Php/UpperCaseKeyword |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Instant (5 mins) |
Precision |
Very high |
Available in |