title: Why is the PHP string concatenation operator a dot (.)?
body: <p>In PHP, the <a href="http://php.net/manual/en/language.operators.string.php" rel="nofollow noreferrer">string operator</a> dot (.) is used to concatenate strings. For example:</p>
  <pre><code>$msg = &quot;Hello there, &quot; . $yourName;
  </code></pre>
  <p>The dot operator always seems to confuse people (myself included) the first time they see it, especially since when you use it to concatenate two strings, the operation does not throw an error, but just &quot;silently&quot; fails. It is also a common mistake when switching between PHP and other languages such as JavaScript, Python, etc. that do not use this operator.</p>
  <p>Why does the language use the dot (.) operator instead of a more widely accepted operator, such as plus (+)? Are there any historical reasons you can point to as to why this operator was selected? Is it just because the dot can cast other variable types to string? For example:</p>
  <pre><code>echo 1 . 2;                // Prints the string &quot;12&quot;
  </code></pre>