Trevor Zegras didn’t mind a late-night visit Monday from his buddy Christian Dvorak.

Not at all.

“It was awesome, I was honored,” Zegras said with a smile. “I was like, ‘This is the coolest thing ever.'”

Dvorak needed someone to be present for when he inked his new five-year, $25.75 million contract extension with the Flyers. He reached out to Zegras, his good friend and teammate who lives nearby.

“He had nobody to be his witness for signing the contract, so he drove over to my house last night at like 11 p.m. and I was his witness,” Zegras said Tuesday morning. “That’s something I’ll never forget.”

It was fitting when you consider Zegras and Dvorak have taken off together in Philadelphia. Both came to the Flyers last offseason and both were in contract years. That’s no longer the case for Dvorak, who has committed long term to the Flyers.

“I’ve just loved my time being here,” the 29-year-old center said. “It’s a great group of guys, we have a lot of fun and it has been a good fit for me. I just like where the team’s headed, we’ve been playing some good hockey this year and I think we’re headed in a good direction here. That’s really important to me.

“We’re still a pretty young team, so I think we’re only going to get better. We’ve got a lot of guys in the pipeline, too.”

As a pending restricted free agent, Zegras is on the final year of a three-year, $17.25 million deal. The 24-year-old was impressed by the commitment between Dvorak and the Flyers.

“It’s cool to see somebody his age, around 29, decide that this is the place he wants to be,” Zegras said. “This is the place that he feels like we can win.

“We weren’t going to let him leave as a group of guys. We were kind of on him all year about sticking around and staying. We were all very happy today.”

Zegras (39 points in 40 games) and Dvorak (25 points in 39 games) are both on pace for career years. They’ve been huge additions for a Flyers team that is 21-12-7 just ahead of the halfway mark. They’ve formed the Flyers’ top line, along with Travis Konecny.

Dvorak is in his 10th NHL season. With his new contract, the Flyers could have him through his 15th season. They’re hoping it’s more of his best.

“He’s just such a good locker room guy,” Zegras said. “I think everybody’s excited to see him when they get to the rink, just a true pro. Not too many guys play 10 years, let alone 15 years. And he has never played one game of ‘sewer’ (soccer warmup) because he’s always stretching and working on his body. He’s the ultimate pro.”