I want to combine two variables together:
$var1 = 'Welcome ';
$var2 = $_SESSION['UserName'];
Which of these will work faster? Code sample 1:
$var3 = $var1.$var2;
Or code sample 2:
$var3 = "$var1$var2";
Code sample 1 won't work at all..
Syntax considerations set aside, Sample 1 should be trivially faster because it doesn't involve parsing a string (looking for variables).
But it's very, very trivial..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With