Marcell Ozuna hit his first career homer and Chris Valaika connected for the first time in three years to stop Cole Hamels (1-4).
The 20-year-old Fernandez (1-2) allowed just a single by Freddy Galvis up the middle in the first. He then retired the next 17 batters.
Fernandez walked Galvis in the seventh, and followed that up by striking out Chase Utley, Ryan Howard and Delmon Young.
Fernandez was lifted after throwing 82 pitches. Mike Dunn pitched a perfect eighth and Steve Cishek finished off the one-hitter to get his fourth save in five tries.
This material may not be published, broadcast, rewritten, or redistributed.