What is the operator precedence for the XOR operator in PHP?

The XOR operator (^) in PHP has a lower precedence compared to other logical operators like AND (&&) and OR (||). This means that when using XOR in combination with other operators, it is important to use parentheses to explicitly define the order of operations. This will ensure that the XOR operation is performed correctly within the overall expression.

// Example of using XOR operator with proper operator precedence
$var1 = true;
$var2 = false;
$var3 = true;

$result = ($var1 && $var2) ^ $var3;

echo $result; // Output: 1 (true)