A T. rex, or Tyrannosaurus rex, is a large, extinct dinosaur. When Phineas, Ferb and Candace were trapped in the Late Cretaceous period a T. rex destroyed the time machine that brought them and chased them. They eventually lost it, but it found them again. When they were back in the present at the museum the T. rex accidentally came with them. It tried to attack Candace but Doofenshmirtz's Freezeanator hit it and froze it. ("It's About Time!")
When the T. rex is chasing Candace, the theme from the Tyrannosaurus rex Grumpy from the 1970s television show Land of the Lost can be heard.
The Tyrannosaurus is depicted having three fingers, instead of having two, similar to the T. rex from the Rite of Spring segment from Disney's 1940 film Fantasia. However, the pictured Tyrannosaurus from Phineas and Ferb's Quantum Boogaloo is correctly shown with two fingers.
It makes some appearances in the series Milo Murphy's Law, being mentioned several times and eventually run into by an antic firetruck, ending up in a statue where it seems to be combatting a firetruck themed machine during the episode The Little Engine That Couldn't. It is then is destroyed in the episode The Island of Lost Dakotas, when Hamosaur 2, a statue of a T Rex made entirely out of ham, crashes into it and takes it's place.