"It feels great," Hernandez said. "Didn't try to overthrow, kept the ball down, making ground balls. That's what I want to do, keep the ball down."
Yankees second baseman Scott Sizemore broke up the perfect game with a single to start the top of the sixth inning, and Hernandez was then relieved by Jeremy Horst.
Up next: David Phelps takes his turn in the rotation when the Yankees meet the Twins on Friday at 1:05 p.m. ET. The game can be seen live on MLB.TV.
The Phillies have been struggling this spring, but they strung together a few hits against the Yankees. After leaving runners in scoring position in the first and second innings, five singles and one double led to three runs in the third inning against Yankees right-hander Ivan Nova to give the Phillies a three-run lead.
Ben Revere, Chase Utley, Marlon Byrd, Ryan Howard and Domonic Brown each singled in the third inning. Darin Ruf doubled down the left-field line, but Brown was thrown out at the plate trying to score.
Jacoby Ellsbury hit a solo homer as part of a two-run seventh for the Yankees. Francisco Cervelli's fifth RBI of the spring plated New York's other run in the inning.
The Phillies added three runs in the eighth, when Reid Brignac doubled home Kevin Frandsen before Tommy Joseph doubled home Clete Thomas and Brignac.
Todd Zolecki is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.