This is a disproportionation. Oxidation states of P: $$0$$ in $$\mathrm{P_4}$$; $$-3$$ in $$\mathrm{PH_3}$$ ($$x + 3(+1) = 0$$); $$+2$$ in $$\mathrm{HPO_2^-}$$ ($$(+1) + x + 2(-2) = -1$$). So P is simultaneously reduced ($$0 \rightarrow -3$$) and oxidised ($$0 \rightarrow +2$$).
Ion–electron method.
Reduction half (balance in acidic form first): $$\mathrm{P_4 \rightarrow 4\,PH_3}$$. Add $$12\,\mathrm{H^+}$$ for the 12 H atoms, then $$12$$e$${}^-$$:
$$\mathrm{P_4 + 12\,H^+ + 12\,e^- \rightarrow 4\,PH_3}$$
Convert to basic — add $$12\,\mathrm{OH^-}$$ to both sides ($$\mathrm{H^+ + OH^- \rightarrow H_2O}$$):
$$\mathrm{P_4 + 12\,H_2O + 12\,e^- \rightarrow 4\,PH_3 + 12\,OH^-}$$
Oxidation half (acidic form): $$\mathrm{P_4 \rightarrow 4\,HPO_2^-}$$. Add $$8\,\mathrm{H_2O}$$ for the 8 O atoms, then $$12\,\mathrm{H^+}$$ to balance H, then $$8$$e$${}^-$$:
$$\mathrm{P_4 + 8\,H_2O \rightarrow 4\,HPO_2^- + 12\,H^+ + 8\,e^-}$$
Convert to basic — add $$12\,\mathrm{OH^-}$$ to both sides and cancel $$8\,\mathrm{H_2O}$$:
$$\mathrm{P_4 + 12\,OH^- \rightarrow 4\,HPO_2^- + 4\,H_2O + 8\,e^-}$$
Balance electrons: $$\mathrm{LCM}(12, 8) = 24$$. Multiply the reduction half by $$2$$ and the oxidation half by $$3$$:
$$\mathrm{2\,P_4 + 24\,H_2O + 24\,e^- \rightarrow 8\,PH_3 + 24\,OH^-}$$
$$\mathrm{3\,P_4 + 36\,OH^- \rightarrow 12\,HPO_2^- + 12\,H_2O + 24\,e^-}$$
Add and cancel $$24\,\mathrm{OH^-}$$ and $$12\,\mathrm{H_2O}$$:
$$\mathrm{5\,P_4 + 12\,OH^- + 12\,H_2O \rightarrow 8\,PH_3 + 12\,HPO_2^-}$$
Oxidation-number method (cross-check). Each reduced P gains $$3$$e$${}^-$$ ($$0 \rightarrow -3$$); each oxidised P loses $$2$$e$${}^-$$ ($$0 \rightarrow +2$$). For the electrons to balance, (P reduced) $$\times 3 = $$ (P oxidised) $$\times 2$$, i.e. reduced : oxidised $$= 2 : 3$$. So out of every $$5$$ P atoms, $$2$$ form $$\mathrm{PH_3}$$ and $$3$$ form $$\mathrm{HPO_2^-}$$. Taking $$20$$ P atoms ($$= 5\,\mathrm{P_4}$$): $$8 \rightarrow \mathrm{PH_3}$$ and $$12 \rightarrow \mathrm{HPO_2^-}$$ — the same equation.
Atom check: P $$20 = 8 + 12$$; O $$12 + 12 = 24 = 12 \times 2$$; H $$12 + 24 = 36 = 24 + 12$$; charge $$-12 = -12$$. Balanced.
$$\mathrm{P_4}$$ acts as both the oxidising agent and the reducing agent (disproportionation).