3
why it is possible to see this behaviour of the logical operator xor
?
$bool = false xor true;
var_dump($bool); // bool(false)
$bool = true xor false;
var_dump($bool); // bool(true)
from what I read, xor
should return true only if one or the other is true, but not both(exclusivity), so should not return everything boolean(true)
?
Wow, then had a fight of different operators, one of assignment and another of logic, and the of assignment came out in front. uffa, now it’s clearer, thank you Rodrigo!
– Ale
That’s right! To see how the operator
xor
Okay, just do onevar_dump(false xor true)
.– Rodrigo Rigotti