Concatenation Operator - PHP

Posted by Chaitanya on Stack Overflow See other posts from Stack Overflow or by Chaitanya
Published on 2010-06-15T00:45:28Z Indexed on 2010/06/15 0:52 UTC
Read the original article Hit count: 345

Filed under:
|

This might be a silly question but it struck me, and here i ask.

<?php
  $x="Hi";
  $y=" There";
  $z = $x.$y;
  $a = "$x$y";
  echo "$z"."<br />"."$a";
?>

$z uses the traditional concatenation operator provided by php and concatenates, conversely $a doesn't,

My questions:

a. by not using the concatenation operator, does it effect the performance?

b. If it doesn't why at all have the concatenation operator.

c. Why have 2 modes of implementation when one does the work?

© Stack Overflow or respective owner

Related posts about php

Related posts about concatenation