CRITICAL
Rule Definition
For the strings using double quotes PHP do some extra processing in order to detect if the string contains any variables.So in this case, echo ‘This is long string’ . $name is faster then echo “This is long string $name”. Concatenation with single quotes is faster and for example for echo ‘This is long string’ , $name, is faster because it does not require any string manipulation.So always prefer single quotes for the strings if you do not use variable in your string.
Remediation
Try to reduce the number of string having double quotes and replace them by strings with simple quotes.
Violation Code Sample
<?php
$variable="This variable contains a long string. that is way it is better to use simple quote"; // VIOLATION
?>
Fixed Code Sample
<?php
$variable='This variable contains a long string. that is way it is better to use simple quote'; //Violation removed
?>
Related Technologies
Technical Criterion
Efficiency - Memory, Network and Disk Space Management
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.