I came across this syntax in a codebase and I can’t find any more info on it. It looks like the caret operator (XOR operator), but because the statement below was executed when a certain condition was met I don’t think that is it.
$this->m_flags ^= $flag;
Because I don’t know what it’s called I also can’t search for it properly..
Update:
Because of Cletus’ answer:
Are the following lines then functionally equal?
$a = $a ^ $b;
$a ^= $b; // the shorthand for the line above
It’s bitwise XOR equals. It basically toggles a flag because I’m getting
$flagis a power-of-2. To give you an example:So the third bit has been flipped. Again: