In order to reproduce the comparative performance that many places present by placing the strings with simple quotes as faster, I used the tool Profiling Blackfire in both versions.
Version using single quotes
<?php // single.php
$string = 'Anderson Carlos Woss';
Version using double quotes
<?php // double.php
$string = "Anderson Carlos Woss";
Note that unlike most other places I won’t be inside a repeat loop, as this tends to insert too much noise into the sample due to various considerations in memory management that the interpreter does. One string fixed can be allocated at compile time and only reused at run time, which would cause the result not to accurately reproduce the sample space. I also did not use the language’s own time functions to measure the time and did not use input and output functions to also insert noise in the result. The script has as its function only to declare the string of the two distinct forms.
Space of 1000 samples has been taken and the result will be based on the average between them:
Sampling using single quotes
Wall Time 87µs
I/O Wait n/a
CPU Time n/a
Memory 35.9KB
Network n/a n/a n/a
SQL n/a n/a
Sampling using double quotes
Wall Time 86µs
I/O Wait n/a
CPU Time n/a
Memory 35.9KB
Network n/a n/a n/a
SQL n/a n/a
That is, in 1000 samples, the average difference between the two versions was 1 μs (1 microsecond, or 0.000001 seconds), even pointing to double quotation marks as shorter time. The only conclusion that comes out of this is that it makes no difference between using single or double quotes in terms of performance to define strings static. It is worth commenting that the I/O, CPU and network times were null as expected and the memory used was the same, because in both solutions the same content was used.
If you are going to see the individual level, it means that using simple quotes implied 1 ns more for each round. This time can be explained easily by the decay of the electron wave function
– Jefferson Quesado