Peripheral processes 2 → 3 and 2 → 4 in QED and QCD in $$p(\bar p)p$$ high-energy collisions