Regardless of that The Orville episode, don’t put your iPhones in a time capsule
If you’re a follower of the show The Orville, last night’s episode might have you thinking of putting your old phone into a time capsule so that future generations can recreate your life and times with AI (and ultimately have sex with a holographic AI powered simulation of you.)

Last night’s episode involved an iPhone from 2015 that had been placed in a time capsule during the timeframe as the owner was about to get a new one and she thought “what the hey, not like a spaceman’s gonna jump my long dead bones in the future”.
The capsule is opened in the year 2420 (I see what you did there Seth,) and everything’s perfectly intact.
We’re given an answer to the question “What better way to experience the lives of past humans than to bonk AI-powered holographic reproductions of them?”
But enough about the somewhat creepy prospects of everything we leave behind digitally.
Your battery will die in a messy fashion
Now, I can’t find reliable specs on how long until a battery expands, but since the introduction of the HTC EVO back in 2010, the batteries that shipped with it that I still have are approximately 10% larger than they used to be.
This is why we recycle old phones, not just stick them in a drawer. Batteries expand, acid eventually eats through things, future spacemen are going to find plastic acid ooze.
If you’re still thinking about it take a look at any AA battery circa 7 years ago with the 10 year warranty. They’re probably leaking by now. Go ahead and contact the manufacturer
Batteries like to kill themselves and everything around them if they can. It’s just a matter of when they break down their containers completely. If they had legs they’d try and hug you and burn you.
We tracked down my wife’s randomly shattering screen to a battery expanding and pressing on the back of her phone several months later when the screen started moving out of the shell (after the phone had been replaced and was sitting in a drawer waiting to catch fire.)

So yeah, your phone’s probably not fit for time capsule storage unless you remove the battery. Also probably not unless you’re cool with random future people having sex with AI generated versions of you.
What the crew probably would have gathered was a mass of battery acid and a puddle of electronics.
Oh, while I may have ragged on that episode a bit, two things to note: 1) The Orville is quite often brilliant and funny, and 2) recycle your old phone before it blows up.