Because damage remains marked on a creature until the damage is removed as the turn ends, nonlethal damage dealt to a creature may become lethal if you switch its power and toughness during that turn.

Artwork
Loading artwork…
Valakut Fireboar
Rise of the Eldrazi · #170 · EN
Nonfoil—Foil—
Card rules
Whenever this creature attacks, switch its power and toughness until end of turn.
1/7
"Just move very slowly, and for the love of Ula, do not get it mad." —Chadir the Navigator
Uncommon · Illustrated by Zoltan Boros & Gabor Szikszai
Format legality
Commander Legal
Duel Legal
Legacy Legal
Modern Legal
Oathbreaker Legal
Penny Legal
PreDH Legal
Vintage Legal
Alchemy Not Legal
Brawl Not Legal
Competitive Brawl Not Legal
Future Not Legal
Gladiator Not Legal
Historic Not Legal
Old School Not Legal
Pauper Not Legal
Pauper Commander Not Legal
Pioneer Not Legal
Premodern Not Legal
Standard Not Legal
Standard Brawl Not Legal
Timeless Not Legal
Tlr Not Legal
Rulings
Published rulings from the downloaded Scryfall catalog. Source card record · Rules and interactions
Switching a creature's power and toughness twice (or any even number of times) effectively returns the creature to the power and toughness it had before any switches.
Effects that switch a creature's power and toughness apply after all other effects, regardless of when those effects began to apply. For instance, if you target a 1/2 creature then give it +2/+0 later in the turn, it's a 2/3 creature, not a 4/1 creature.