I just performed an interesting and unintentional scientific experiment with an empty milk carton. After finishing off a gallon of (skim!) milk, I went to rinse it out so that the milk didn't sit and smell. When I first turned the faucet on, it was set to spew out hot water, which I realized was unnecessary, so I changed it to cold water after a few seconds. I put the top on, and shook.
When I went to open the carton, I noticed that the sides were puffed out and when I took the top off, a bit of air rushed out. Interesting, I thought, why does this happen?
After a few tests, I found that I was reliably able to reproduce this effect by filling the carton with a few seconds worth (around 3ish) of the hottest water the sink could put out, switching to the coldest water it could put out, and then putting the lid on and shaking. Every time, it would puff out the bottle. Also, filling it with just hot water or just cold water did not have an effect.
After spending a few minutes testing, I had isolated the effect, but did not know the cause. Luckily, my dad happened to be around, and suggested that the answer had something to do with the fact that cold water has a higher capacity for dissolved gas than warm water.
It is just a guess, but I think it could be that the cold water brings extra oxygen (or whatever is dissolved in it) into the carton, and when it is mixed with the hot water, its ability to retain the dissolved gas decreases. The warm and cold water stay separate long enough that there is time to put the cap on, and shaking the bottle mixes them up and causes the cold water to release its gas.
If this is correct (and there is an excellent chance that it is not; I haven't taken chem since 10th grade), it would also mean that the cold water gives up more gas by heating up than the hot water absorbs by cooling down. This seems to suggest that the gas absorption to temperature function is non-linear (or my measuring methods of "about 3 seconds" are not very precise).
Try it at home! All you need is an empty milk carton (or any largeish container which you can close quickly), a faucet which can switch between hot and cold water fairly quickly, and your imagination!