Last week South Africa's parliament voted in favour of a fiercely contested secrecy bill.

The protection of state information bill, which will replace apartheid-era legislation on classified information and espionage, passed with 189 votes in favour to 74 against, with one abstention.

President Jacob Zuma now has to sign and make it law. That could be as early as this week.

The minister of state security, Siyabonga Cwele, told Parliament the bill would "strengthen democracy while balancing transparency and protecting our national security and national interests".

Under the bill, espionage-related cases carry a punishment of up to 25 years in jail, and holding or disclosing classified material carries a maximum of five years' imprisonment.

But there is opposition from the media, rights groups and the opposition who fear it will be used to persecute whistleblowers and stifle press freedom in country where the media regularly uncover government corruption and wasteful spending.

South Africa's restrictive laws on reporting were overturned when the country became a democracy in 1994.

Now, some South Africans fear a return to the old days saying this won't only affect journalists but every South African.

This reminds me of the Access to Information and Protection of Privacy Act (AIPPA) in neighbouring Zimbabwe. It was introduced in 2002 by a then ZANU PF–dominated government to oversee how the print and electronic media operated in the country.

Journalists, especially international journalists, have to go through strict screening processes – applying to come into Zimbabwe to report.

At one point it was practically impossible to get accreditation if one was perceived to be from a hostile media house or country. Those that snuck into the country without accreditation risked being arrested.

Some would escape unscathed and go back to their respective countries with a few good stories. The few that got caught were detained briefly and deported. One or two managed to write a book about their time in Zimbabwe.

It's a different more dangerous ordeal for local journalists. If you are caught reporting without accreditation your, detention will not be brief like the foreigners. Often one is detained for several days and the police systematically beat you. Many Zimbabwean journalists have fled the country and are living in exile because they went through this.

But even if one has accreditation from the government it does not mean working in Zimbabwe is any easier. Officials still don’t want some things reported, things that could make the country and the government look bad.

I am not saying what happened or what is happening in Zimbabwe will happen in South Africa. It might not even be that extreme. There are other countries around the world where freedom of speech and reporting is restricted. South Africa's case may not be the most extreme.

But there are enough people here who are worried, who say they fear a return to the apartheid days.

Those who oppose the bill becoming law are threatening to take the matter all the way to the constitutional court.