I\'m a little confused when I see the output of following code:
$x = \"a\"; $y = \"b\"; $x ^= $y; $y ^= $x; $x ^= $y; echo $x; //Got b echo $y; //Got a
In this example, when you're using ^ characters, they are casted to integers. So
"a" ^ "b"
is the same as:
ord("a") ^ ord ("b")
with one exception. In the first example, the result was casted back to a string. For example:
"a" ^ "6" == "W"
because of:
ord("a") ^ ord("6") == 87
and
chr(87) == "W"