IPhone overheated while charging?

I have an iPhone 6. I plugged it in and left it on a table before going to bed as i usually do and I woke up in the middle of the night last night to check missed messages and the phone was about to burst into flames it was that hot. It had the high temperature warning and it did not charge. I used the apple cord and plug that came with it. It seems to work now but battery is losing power faster than usual. Should I take it to apple?

I would take it to someone. Something could be malfunctioning.

I would.