Each nation determines its own entry requirements. Countries may have signed reciprocal entry agreements (treaties) that establish different entry requirements for visitors from certain countries. Many nations require that visitors from other countries prove that they have enough money to last for their entire visit. Some may also require that visitors have a ticket to return home or an onward ticket to another country.
These requirements are sometimes waived for visitors (usually from certain countries) for short visits (30 days, for example). In practice, they’re often enforced only when border officials have reason to suspect that a visitor seeking entry may lack sufficient funds. For example, border officials may treat a scruffy backpacker walking up to a land border differently than a well-dressed businessman arriving on an international flight. Basically, countries want to deny entry to people who have little money because they may become vagrants, engage in crimes, attempt to work or immigrate illegally, or otherwise become a burden.
The U.S. State Department provides basic entry requirements for all countries. For an example of a country that may ask visitors to provide proof of sufficient funds, onward/return ticket, and lodging accommodations, check out the entry for Aruba.
I have traveled out of the country several times and have never encountered this law. I almost never have the correct currency when entering a country (if you want that you should contact your bank a minimum of two weeks before your departure in order for them to obtain it for you), and need to seek out a money exchange center or an ATM where I can withdraw funds from my account directly into Euros, Swiss Francs, or whatever the currency of the country I am in may be.
Last year I traveled to the UK and did not have any trouble either there or in Canada, where we had a six and one half hour layover in the airport. Not one customs agent asked me if I had travel money for the country which I was entering.
I don't know for sure if such a law exists, but from my experiences, I can tell you that I don't think this is the case.