I recommend you read this article.
There is a big difference between shell and environment variables. PATH is one of environment ones, and is already exported (by default), so by changing it, the current shell your using and all the others - any child shells or processes - will be affected.
PATH is list of directories that the system will check when looking for commands. So even if you wanna change it or add something to it, it's better to use
PATH="$PATH:... since you need to have the original PATH for executing commands, but if you alter this completely, you should use your commands by entering their absolute path, for instance
But foo which you're exporting is not something having any effect on shell or processes, I know you're trying to making it a environment variable, but you haven't defined something effective yet so that's why you cannot see what effect it can have on other things, in fact it's what you're defining because of you own needs at the moment, i.e. to keep track of some ephemeral data, so it'd be better to keep it just a shell variable. For instance, when you're trying to do some mathematical projects, you might be in need of defining something and have them for a short time, so you can set just some shell variables without needing to export them.
I hope I could be precise, but I still recommend you read the given article, and play around with changing some of those variables so you'll fully understand. BTW, if you want a environment variable to be permanent, you should add them as a line in your