Rayleigh--Taylor instability in two dimensions and phase-field method