I'm simply a lowly MA candidate in Graeco-Roman History, but soon I'll be working on my PhD (soon meaning a year or two). That said, my understanding is that the phalanx (and the legion) for the most part maintained formation. When phalanxes collided, it was also a pushing-match between the two armies.

According to Bernard Bachrach, the Carolingian Franks used the same system (but this is highly debated), citing accounts of the press being so tight that the dead were trapped standing, unable to fall at the Battle of Tours. Many believe it was the same with phalanx warfare.