It's legal to tell people to disperse... it's not not something that they need to do.A dispersal order can only be used against a crowd of 3 or more:
Source: https://www.legis.state.pa.us/WU01/LI/L ... 2.000..HTM§ 5502. Failure of disorderly persons to disperse upon official order.
Where three or more persons are participating in a course of disorderly conduct which causes or may reasonably be expected to cause substantial harm or serious inconvenience, annoyance or alarm, a peace officer or other public servant engaged in executing or enforcing the law may order the participants and others in the immediate vicinity to disperse. A person who refuses or knowingly fails to obey such an order commits a misdemeanor of the second degree.
So what the cop did, with the dispersal request, is not legal.
I can walk around telling random people to disperse... but they don't have to.