I understand that, well, it depends on which phalanx, so if the question meant for Ancient Greece is still too broad, someone let me know and I will focus the question on a concrete age.
You might want to specify whether you mean the earlier phalanx commonly associated with the Persian and Peloponnesian Wars that had larger shields and shorter spears or the later Macedonian phalanx with smaller shields and wielding longer spears called sarissas.
Whilst I haven't been able to find an answer to your specific question in there the the AskHistorians wiki has some really good stuff about Ancient Greek warfare.