If multiple phases are added to the same point in your turn, the most recently created phase happens first. For example, say you are enchanted by Shadow of the Second Sun and its ability triggers during your postcombat main phase. Later during that same main phase, another effect gives you an additional combat phase after this main phase. The additional combat will happen first, followed by the additional beginning phase.