const commonAndUnique = (...arrs) => Array
.from(arrs
.flatMap(n => [...new Set(n)])
.reduce((acc, n) => acc.set(n, (acc.get(n) ?? 0) + 1), new Map))
.reduce((acc, n) => (n[1] === arrs.length && acc.push(n[0]), acc), []);
// или
const commonAndUnique = (...arrs) =>
[...new Set(arrs[0].filter(n => arrs.every(m => m.includes(n))))];
Убил бы.
Какой на хрен php, если указан тэг javascript?