This is contested on the internet, ha!
http://www.answerbag.com/q_view/1391442

I always used to say "phew" for everything, but I have a friend who uses exclusively "whew":

We had a huge fight about it and aren't talking now... just kidding, neither of us cares that much. Would love to know definitively which word to use in which cases though!

Do you say "whew" or "phew"? What's the difference?