iPhone troubles

I have an iPhone 5 I know it's going to be outdated very soon. But it's acting really weird, sometimes it opens apps by itself and deletes what I text. Closes apps as well. Does anybody know what's going on with my phone. Could it be hacked?