I just ran across this snippet of code for swapping the values of two variables in PHP:
PHP applies bitwise operators to strings by applying it to each character individually.
PHP: Bitwise Operators:
Be aware of data type conversions. If both the left-hand and right-hand parameters are strings, the bitwise operator will operate on the characters' ASCII values.
This will work if both strings have the same number of characters, or more precisely the same number of bytes. If the above quote is really precise, then it may only work for ASCII-only strings.