Left Iphone infront of space heater, will putting it in the fridge

I just messed up so bad. I put my space heater down by my bed on the floor and put it on max heat. About an hour later I decided to check my phone and realized it was laying directly in front of it. It was too hot to touch and the temperature warning was on the screen. I immediately turned it off and put it in the fridge. Is there any hope for it? I feel like I'm going to be sick.

OMFG TAKE IT OUT OF THE FRIDGE NOW!
NONONONONO YOU DO NOT WANT TO PUT ELECTRONICS IN THE COLD LIKE THAT. IT COULD FREEZE OVER THE CIRCUTS… MY ADVICE TO YOU: turn it off completely (good job if you already have) don't do ANYTHING with it for a few days… Just leave it be, out of any heat (that does NOT mean the fridge)… Then turn it on after a few days. Thats the best chance you have for it (lol sorry for all the caps lock)

The fridge is a bad idea. Taking a hot or warm appliance and putting it in there will cause condensation to form, possibly frying the innards. Room temperature will be fine to cool it. Wait a few hours.