Attributed to Solomon W. Golomb; a method for swapping the values of two integer variables without using an intermediate variable (you can tell this dates from the Elder Days, when variables were expensive!). Thanks to PHP's syntax it's also a one-liner.
$a^=$b^=$a^=$b;
Okay, here's how it goes (yeah, like I need to make content-free posts just for the sake of an increment...).
First, simplify the line; noting that ^= is right-associative, which means that in that line the rightmost operator is evaluated first, that the assignment operators also return the value that they assign to their lvalue, and that foo^=bar is shorthand for foo=foo^bar:
<DIV dir=ltr style="TEXT-ALIGN: left"> $a^=$b^=$a^=$b; $a^=($b^=($a^=$b)); $a=$a^b; $a^=($b^=$a); $a=$a^$b; $b=$b^$a; $a=$a^$b;
<DIV dir=ltr style="TEXT-ALIGN: left"> x y | x^y ------+---- 0 0 | 0 0 1 | 1 1 0 | 1 1 1 | 0
<DIV dir=ltr style="TEXT-ALIGN: left"> $a = $s; $b = $t; $a=$a^$b; $b=$b^$a; $a=$a^$b; // Since $b==$t, we substitute $t for $b for as long as $b doesn't change $a = $s; $a=$a^$t; $b=$t^$a; $a=$a^$b; // And likewise for $a $a=$s^$t; $b=$t^$a; $a=$a^$b; // But don't stop there! $b=$t^($s^$t); $a=($s^$t)^$b; $b=$t^($s^$t); $a=($s^$t)^($t^($s^$t));
<DIV dir=ltr style="TEXT-ALIGN: left"> $b=$t^($s^$t); $a=($s^$t)^($t^($s^$t)); $b=$t^($t^$s); $a=($t^$s)^($t^($t^$s)); $b=($t^$t)^$s; $a=($t^$s)^(($t^$t)^$s); $b=0^$s; $a=($t^$s)^(0^$s); $b=$s; $a=($t^$s)^$s; $b=$s; $a=$t^($s^$s); $b=$s; $a=$t^0; $b=$s; $a=$t;
So after starting out with $a=$s and $b=$t, we end up with $a=$t and $b=$s. In other words, ^ swapped the each pair of bits of $a and $b with each other. Do that for all the bits and the result is one of $a and $b being swapped.
And after all that is it any mystery why (a) XOR is such a useful operation in cryptography, and (b) learning a bit of maths (boolean algebra in this case) can be useful in programming?