1.2.1096. 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.1096.1. Specs

Short name

Type/ShouldBeSingleQuote

Rulesets

All, Coding conventions

Exakat since

0.8.4

PHP Version

All

Severity

Minor

Time To Fix

Instant (5 mins)

Precision

Very high

Features

double-quote, single-quote

ClearPHP

no-double-quote

Available in

Entreprise Edition, Exakat Cloud