I'm going to make a time capsule for 25 or 50 years, and I don't know whether it's safe to put food, e.g. bottle of cola there.
Depends on the food and the way it's packed, but food is not something I'd suggest you pack for such a long period..
Will it explode and ruin the capsule ?
Food or drink are very unlikely to explode (maybe alcohol would in the wrong circumstances).
But food can be unsafe to eat in quite a short time, depending on the food, preparation and packing and how you store it. Bacteria could be a problem.
Most food will go bad over a period as long as you're describing without very specific storage (like refrigeration, and even then I'd say most things won't work).
The safest ones would be :
- popcorn (kernels)
- honey (jar of)
- sugar (most forms)
- alcohol (spirits like vodka, whiskey)
- dried beans, dried lentils
I would not be planning to eat any of these stored for 25 years myself. And in general I'd suggest testing the items before trying them after 25 years or more (if you feel you must).
I would not expect cans or glass or plastic bottles of soda to be in good shape after anything like 25 years. The plastic might not survive without degrading. The can and plastic might react with the liquid over that timescale and the glass would survive but I'd be less optimistic about a sugar laced chemical soup like soda or cola not undergoing some changes. Hard to say.
If you want more info on this try this website.
Will it be ok to drink it, if it won't explode?
I would not try it. At best it soda would be flat and possibly not taste the same (chemical changes over that timescale ?) and at worst it could actually be harmful.
Exploding seems very unlikely.
Also, what about Snickers or a hamburger in a ziploc package with air sucked out of it with vacuum cleaner?
Air isn't the issue. There are bacteria that will happily live (and increase in numbers) on what's in the food. Well, it is food, after all. There are bacteria that will survive refrigeration as well. Over the timescale you're talking about I'd say it's all bets are off territory.
So: will Snickers, Hamburger in a ziploc, Bottle (or can) of Cola, all not opened, go crazy in 25 years? In 50 years?
All of those could be dangerous over such a long time period, IMO. At the very least they'd taste bad and at worst they'd kill you if you consumed them.
If so, can they go out of their packages and ruin the contents of the time capsule? If not, will it be safe to consume one of them?
Depends on the packaging. Glass would last indefinitely baring physical force or extreme of hot and cold (which might possibly cause fatigue cracking). The other wrappers would last pretty well (structurally), but 25 years is way past their design intentions. It would be a dice throw.