People have been making jokes all week about how the Philadelphia Flyers could just go and dump salary on the Arizona Coyotes, since that team needs to reach the salary cap floor in a desperate way.

Nobody really expected it to actually happen. BUT OH MY GOD, RON HEXTALL IS A MAGICIAN.

The Philadelphia Flyers have acquired 5-11, 202 lb C Sam Gagner and a conditional 2016 or 2017 draft pick from the Arizona Coyotes in exchange for D Nicklas Grossmann and the contract of D Chris Pronger, according to general manager Ron Hextall.

Unbelievable. This is the best weekend the Philadelphia Flyers have had since ... 2010 when they were in the Stanley Cup Final? I mean, between an awesome first round of the draft last night, to this shocking, out-of-nowhere deal that the team desperately needed, Hextall just bought himself a lot of new believers to his process.

All in all, the Flyers will save at least $5 million against the cap with this move -- and that number could jump up to $8 million depending on a few things.

What the Flyers get rid of

With Grossmann gone, the Flyers both free up a valuable roster spot on defense and shed themselves of a terrible $3.5 million defenseman who was an unmitigated disaster last season and had no real right to a spot on Dave Hakstol's defense. They have retained $500,000 of Grossmann's salary, according to Sportsnet, so that's still a savings of $3 million.

With Pronger gone, they save another $4.9 million against the salary cap and will no longer have to use LTIR relief just to get within compliance. So together, that's $7,941,429 in cap savings by losing these two contracts.

Buy out for Gagner?

In acquiring Sam Gagner, the Flyers add a $3.2 million cap hit but could always buy the guy out. If they keep him, he's really not a terrible forward -- certainly better than some of the guys currently on the team. He'd probably be a bottom six guy, but could be an improvement over R.J. Umberger or Vincent Lecavalier. Gagner's contract expires at the end of the 2015-16 season.

Buying him out does indeed seem like a possibility, though.

If Flyers buyout Sam Gagner, it will cost very little, even on cap. He's under 26 so they would only pay one-third of his salary. — James Mirtle (@mirtle) June 27, 2015

To be precise, it would cost the Flyers $633,000 against the salary cap if they were to buyout Gagner, according to TSN. So in total, here's the deal:

If Flyers buy out Gagner, they’ll wind up with $7.3m in cap savings with this deal. If they keep Gagner, it’s about $4.7m. — Broad Street Hockey (@BroadStHockey) June 27, 2015

Wait, isn't Pronger a league employee?

Hahaha, yeah. So this is pretty weird. Chris Pronger has been effectively retired from hockey for years -- he works for the NHL's Department of Player Safety and he's eligible and likely to be inducted into the Hall of Fame this fall. So he's done, and everybody knows he's done.

The Flyers are still paying him, though, because they would be totally screwed if he actually retired. They wouldn't have been able to use LTIR all these years to hide his cap hit.

It's weird that they got to use that loophole, and it's weird that a league employee who makes decisions that impact things on the ice is still on their payroll. And it's weird that the NHL doesn't really seem to care.

#Flyers consulted with NHL last year when he took job with department of player safety and were told they could trade him like any player. — Stephen Whyno (@SWhyno) June 27, 2015

So, you know ... think about that every time you say the NHL hates the Flyers.

Oh, and a draft pick?

CHERRY ON TOP! BLESS YOU RON