Photonic quantum information processing, one of the leading platforms for quantum technologies1–5, critically relies on optical quantum interference to produce an indispensable effective photon–photon interaction. However, such an effective interaction is fundamentally limited to bunching6 due to the bosonic nature of photons7 and the restricted phase response from conventional unitary optical elements8,9. Here we propose and experimentally demonstrate a new degree of freedom in the optical quantum interference enabled by a non-unitary metasurface. Due to the unique anisotropic phase response that creates two extreme eigen-operations, we show dynamical and continuous control over the effective interaction of two single photons such that they show bosonic bunching, fermionic antibunching or arbitrarily intermediate behaviour, beyond their intrinsic bosonic nature. This quantum operation opens the door to both fundamental quantum light–matter interaction and innovative photonic quantum devices for quantum communication, quantum simulation and quantum computing.