>>149346222I was going to give you a long plot breakdown, but all you need to know is that because of Candace and Doof, time and space was breaking apart, after they used an invention to make the day repeat over and over so they'd have multiple chances to accomplish their goals in the last day of Summer.
Doof actually becomes Tri-Governor, but Vanessa is tired of his bullshit and says she's leaving him for her mom, she then says he could just be good and he agrees, Doof is good, which is then followed up on Doof 101, OWCA Files, ans Milo Murphy's Law.
Finally, after they fix reality, Phineas, Ferb, Candace, and their friends sit down under the tree to talk about all their fun Summer memories. Meanwhile, at Doof's house, Heinz, Perry, Vanessa, and Norm do the same.
Then they all get together, sing a song thanking (You) for coming along, and the show ends.
https://youtu.be/lA1yna3smMg