null coalescing

$a xor $b

Logical xor

Check if only one of the conditions is truthy.

Tags
true xor false;  // true
false xor true;  // true
true xor true;   // false
false xor false; // false

1 xor 0;         // true
1 xor '1';       // false
0 xor '';        // false

What is this? Who are you!?

PHP Operators is a reference guide for operators old and new in the PHP programming language. We're SPATIE, a web development agency from Belgium. Besides client work we like to contribute to the open source community and make fun projects like this one.