Webdesign and development in the Czech Republic

String variables concatenation vs variable interpolation

If you use PHP to write web applications, then you definitely know about different types of putting variables into a string. Here they are:

$var1 = "Some string $var2";

and

$var1 = 'Some string ' . $var2;

What method do you use? Why? Actually long time ago people tested which of the ways was faster. And they came to the conclusion that the second way is much faster. But it was at the time of PHP4. How do you think is it still true for PHP5 or not? Let’s check it: