The problem is operator priority. The statement xorhas a lower priority than =, so your statement is equivalent to:
($value = $a) xor $b;
You need to write:
$value = ($a xor $b);
or
$value = $a ^ $b;
^ XOR, . true false 1 0, . , - , - XOR , , .
. PHP
. PHP bool: