There are 3 operations with sets in mathematics: intersection, difference and union (unification). In PHP we can do this operations with arrays:
The + operator:
+
$x[0] = 4; $x[1] = 1; $y[0] = 9; $y[2] = 5; $u = $y + $x; // Results in: $u[0] === 9; $u[1] === 1; $u[2] === 5;
Note that $x + $y != $y + $x
$x + $y
$y + $x