The boy continued to whip the pony , and eventually the pony threw him over. John laughed out quite loud. "Good for *him* ," he said.

Do "pony" and "him" have the same meaning?
yes