After the recent update, some trainers have encountered a bug that gave them huge amounts of experience in a single Gym Battle.
A Gym normally holds between one to 10 Pokémon, but a bug increased the enemy cap. It does not look like a visual glitch since it gave the trainers the exact amount of experience shown.
User A1Ale posted on the Pokemon GO subreddit an image of him finishing a Pokémon Gym raid. It showed the end-game stats where he somehow defeated 90 Pokémon, rewarding him with 13,500 experience. The Pokémon Gym he attacked belonged to Team Valor with 1253 Prestige and is located at Candangos, Brasilia, Brasil.
According to the thread starter, the bug occurred after a lot of players attacked the same Gym. After the raid, the game lagged for a bit and it gave each participating trainer huge amounts of experience. However, some received more experience and defeated more Pokémon than others.
Trainers have not yet discovered how to fully replicate the discovered bug, but it seemed to only happen after the update. Another user did the math and trainers can gain at least 400,000 experience per hour if abused.