Britain will close its borders to people from countries like Greece if the eurozone — the group of 17 countries which use the euro as their common currency — collapses, British Prime Minister David Cameron has said. Cameron has vowed to do \"whatever it takes\" to protect Britain from a flow of migrants, the ‘Daily Express’ reported. The prime minister was asked by MPs at a hearing of the House of Commons\' liaison committee about the danger that Britain could be seen as a safe haven for migrants if the single currency imploded. \"We obviously have contingency plans for all sorts of different eventualities. That is the right thing for a government when there is so much uncertainty,\" Cameron said. Membership of the European Union means countries — in most cases — are powerless to keep out citizens of other European countries but limits are allowed in \"exceptional\" circumstances. \"I think the legal position is that if there are extraordinary stresses and strains it is possible to take action to restrict migratory flows,\" Cameron said. Asked whether he would toughen border rules in relation to troubled states such as Greece, Cameron said: \"I would be prepared to do whatever it takes to keep our country safe, to keep our banking system strong, to keep our economy robust.\"