You can attack phalangites with other phalangites. Its usually fine if phalanxes don't start stacking ontop of each other.