Concatenation Operator

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 1:22 UTC
Read the original article Hit count: 335

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:

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

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

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

© Stack Overflow or respective owner

Related posts about php

Related posts about concatenation