Single-shot determination of quantum phases via continuous measurements