what is faster?

Report
Question
735 views

Combining two variables as follows:

Please explain why do you think this question should be reported?

Report Cancel
$variable1 = 'Hello ';

$variable2 = 'World';

$variable3 = $variable1.$variable2;

 

OR

2- $variable3 = "$variable1$variable2";

 

$variable3 will contain “Hello World”. The first code is faster than the second code especially for large large sets of data.

 

PHP

Thread Reply

Leave an comment

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>