What are the differences between the concatenation operator (.) and the bitwise AND operator (&) in PHP?

The concatenation operator (.) is used to combine two strings together in PHP, while the bitwise AND operator (&) is used to perform a bitwise AND operation on two integers. It is important to be aware of the difference between these two operators to avoid unintended results when working with strings and integers in PHP.

// Concatenation operator example
$string1 = "Hello";
$string2 = "World";
$concatenatedString = $string1 . $string2;
echo $concatenatedString; // Output: HelloWorld

// Bitwise AND operator example
$number1 = 5; // 101 in binary
$number2 = 3; // 011 in binary
$result = $number1 & $number2;
echo $result; // Output: 1