1.2.1105. Should Be Single Quote¶
Use single quote for simple strings.
Static content inside a string, that has no single quotes nor escape sequence (such as n or t), should be using single quote delimiter, instead of double quote. If you have too many of them, don’t loose your time switching them all. If you have a few of them, it may be good for consistence.
<?php
$a = "abc";
// This one is using a special sequence
$b = "cde\n";
// This one is using two special sequences
$b = "\x03\u{1F418}";
?>
1.2.1105.1. Connex PHP features¶
1.2.1105.1.1. Specs¶
Short name |
Type/ShouldBeSingleQuote |
Rulesets |
|
Exakat since |
0.8.4 |
PHP Version |
All |
Severity |
Minor |
Time To Fix |
Instant (5 mins) |
Precision |
Very high |
ClearPHP |
|
Available in |