text:
Fulcrum is an independently owned asset management firm with five core capabilities: Macro & Multi-Asset, Risk Premia, Alternative Solutions, Thematic Equities, and Climate-Aligned Investing.
Climate-Aligned
Climate-Aligned Investing
Fulcrum Diversified Absolute Return Fund
Fulcrum Fixed Income Absolute Return Fund
Fulcrum Climate Change Fund
Fulcrum Thematic Equity Market Neutral Fund
Fulcrum Equity Dispersion Fund
Fulcrum Risk Premia Fund
Fulcrum Multi Asset Trend Fund
Global markets driven by a huge real monetary shock
Fund Literature Library
We have a range of funds designed to reflect our clients' risk appetite and to deliver returns in the broadest range of market environments.
We focus on providing investment solutions that are aligned with our clients' risk appetite to deliver returns in the broadest range of market environments.
Our investment approach is guided by theory, backed by empirical evidence and unconstrained by traditional benchmarks.
Partnering with you
Fulcrum offers a range of compelling investment capabilities, and has over 15 years of experience developing and delivering customised solutions for our clients.
A look at the outlook for UK GDP growth and why it will remain challenged relative to its G7 peers.
Authors: Filippo Cartiglia
Economic growth is a key focus of Rishi Sunak's UK government, but upon close inspection the UK economy has a fight on its hands. Data reveals that the UK is the only G7 country whose GDP has failed to move into positive territory since the Covid-19 pandemic. As of Q3 2022, it was still -0.8% below the Q4 2019 pre-Covid level, lending evidence to suggest that the full impact of the pandemic has yet to be resolved.
By comparison, real GDP has risen by 4.2% in the US and by 2.2%1 in the Eurozone.
The chart below illustrates the situation.
As can be seen, all three economies suffered a sharp decline and fast V-shaped recovery immediately after Covid broke out. The US was the quickest economy to recover back to its pre-Covid level, by March/April 2021, but by comparison, the UK would appear to have suffered a deeper, longer decline that has yet to be reversed.
All three economies have been experiencing a slower rate of growth during the past two quarters suggesting that the bulk of the post-Covid recovery has been realised.
One of the reasons for why the US economy has proven resilient, certainly in the last 12 months, is due to it being less adversely affected by the energy shock than Europe, where the fundamental problem has been an increase in the price of natural gas coming from Russia. By contrast, the US has largely been insulated from the energy crisis. Indeed, between March and October this year, it was the biggest importer of LNG to Europe, shipping 30.8 million tons as the region weans itself off Russian reserves.
This reliance on finding energy alternatives, coupled with the ongoing war in Ukraine, is likely to curtail GDP growth in the UK, Germany and France in 2023, compared to their G7 non-European peers.
All of which presents something of a headache to Sunak's government. Why has the UK experienced such sluggish GDP performance and what might the solution be?
Delving into the figures to try and explain the UK's GDP shortfall, it can be found that total hours worked in Q3 2022 were 1.1%2 below their Q4 2019 level. Moreover, the employment inactivity rate (those who are no working nor seeking to work) was 1.2% higher than 2019's level while the employment rate was 1.1% lower: meaning fewer people in the labour market and fewer jobs being created.
The International Longevity Centre, a UK think tank, suggest in its Plugging the Gap report, that the UK economy could have a labour shortfall of 2.6 million workers by 2030. Currently, the country faces a shortfall of 600,000 workers deemed unwell to work because of health reasons.
This labour shortage explains why GDP growth has been so challenging, even though another key metric, the unemployment rate, is lower than it was pre-pandemic: 3.7% in Q4 2022 compared to 3.8% in Q4 2019.
The fact of the matter is, the UK is suffering from a more severe supply constraint issue than other G7 countries.
Usually, in a recessionary environment there aren't enough jobs. After the global financial crisis, a lot of people lost their jobs and the UK economy was in a bad state. Today, that's not the case. The economy is not in a bad state and there are plenty of jobs. The food and beverage sector alone is crying out for workers, as is the tech sector. According to UK labour market statistics, there were 1.19 million vacancies for the period September to November 2022, which is 391,000 more than pre-pandemic levels.
Part of the reason for the increased inactivity rate, post-Covid, is health-related. Some people are suffering from long Covid, others need surgery or specialist treatment. NHS waiting lists are at record highs, according to the British Medical Association, having ballooned to over 7 million people from a pre-pandemic level of 4.2 million.
How can the UK remedy this problem?
Brexit meant a lot of European workers left the UK during the pandemic and simply haven't returned. As a result, the UK economy lost a part of its population, whose inactivity rate, pre-pandemic was very low. Immigration therefore now be part of the solution to address the gap in supply and if done properly, could kill two birds with one stone.
In 2022, the UK has opened its doors to people from Hong Kong and from Ukraine. This has been a positive step and one that the UK government now has the chance to further pursue, attracting not just workers from the European Union but from across the globe. Doing so would go some way to addressing the UK's tight labour market.
Some prominent figures such as Simon Wolfson, the chief executive of the UK clothing retail chain, Next, are urging the government to take a different approach "to economically productive migration" to address the labour shortage, even floating the idea of imposing a 10% tax on foreign worker salaries to ensure they are being brought in by necessity, over and above UK workers.
Until the labour shortage problem is overcome, the outlook for UK GDP growth will remain challenged relative to its G7 peers.
1: Fulcrum Asset Management LLP
2: Datastream
Delving in to the figures to try and explain the UK's GDP shortfall, it can be found that total hours worked in Q3 2022 were 1.1%2 below their Q4 2019 level. Moreover, the employment inactivity rate (those who are no working nor seeking to work) was 1.2% higher than 2019's level while the employment rate was 1.1% lower: meaning fewer people in the labour market and fewer jobs being created.
In 2022, the UK has, this year, opened its doors to people from Hong Kong, from Ukraine. This has been a positive step and one that the UK government now has the chance to further pursue, attracting not just workers from the European Union but from across the globe. Doing so would go some way to addressing the UK's tight labour market.
FC150W 151222
Filippo Cartiglia
Filippo is a member of the Investment Team. Before joining Fulcrum in 2020, he was the chief economist at Arrowgrass Capital Partners LLP. Prior to this, Filippo was Managing Director at Goldman Sachs, partner at Newman Ragazzi LLP, and an economist at the International Monetary Fund in Washington. Filippo graduated from Bocconi University in Milan in 1988 and gained a PhD in Economics from Columbia University in New York in 1992.
Cookies and Data Privacy Policies
You can find out the different types of cookies used on our website in our Cookies and Data Privacy Policies.


text:
Citizen Voices
اردو کے لئے کلک کریں
Is Sarmad Khoosat's Zindagi Tamasha Pakistan's Padmaavat?
Naya Daur January 21, 2020
Hindu Girl Kidnapped In Jacobabad, Sindh
Hareem Shah's Life And Qandeel Baloch's Death
Asif Ghafoor's Legacy As DG ISPR
Accused Confesses To Raping, Murdering 7-Year-Old Girl In Nowshera
PML-Q Unofficially Takes Over Punjab Government: Report
63-Year-Old Retired Military Doctor Summits Highest Mountain Outside Asia
Activist Parveen Rehman Was Killed By Land Grabbers, JIT Tells SC
The Kind Of Leaders Pakistan Needs
M Aamer Sarfraz January 21, 2020
Before Criticising Britain For Racism, Indians Should Set Their Own House In Order
Justice Markandey Katju January 21, 2020
Editorial | Intimidation Of Rights Activists Must End
Bonded Labour Through Interest Rate Arbitrage
Abdul Qayyum Khan Kundi January 20, 2020
Review: Shuja Nawaz's Explosive New Book Busts Some Long-Standing Myths
Ahmad Faruqui January 21, 2020
Timeline Of The Two-Nation Theory
Ishtiaq Ahmed January 20, 2020
Interview — Liberals Or Secularists Are Not Confined To Any Single Class: Afiya Zia
Mapping History: South Asia Through The Ages
Nadeem F. Paracha January 15, 2020
Hamza Azhar Salam January 19, 2020
What Manto Means To Me
PIC Incident Is Reminder Of Deep-Rooted Flaws In Our Education System
Anum Malik January 14, 2020
The World Is Not A WWE Ring, Mr. Trump!
Adeel Samar January 12, 2020
Donate To Naya Daur
Features History Politics
2018 Election in Pakistan in the context of history
Nadeem F. Paracha September 26, 2018
In this article Nadeem Farooq Paracha discusses the historical evolution of Pakistan's democratic tradition leading up to the 2018 General Election and the rise of Imran Khan to power.
Pakistan's early problems with democracy
Parliamentary democracy in Pakistan was first introduced in 1970 — 23 years after Pakistan's creation in August 1947. Since Pakistan's first general election based on adult franchise in 1970, the democratic process in the country has been interrupted by two lengthy military regimes and frequent covert inferences by some primary state institutions.
From 1947 till 1958, Pakistan saw the coming and going of seven prime ministers who were all installed by two indirectly elected Constituent Assemblies. In 1956, the country authored its first constitution. The constitution emphasized that Pakistan was to become a parliamentary democracy. But in October 1958, President Iskandar Mirza dismissed the country's national assembly and seventh prime minister in a military coup executed with the aid of then military chief, Ayub Khan. Twenty days later, Khan ousted Mirza.
According to one of Pakistan's leading sociologists, late Hamza Alavi, at the time of Pakistan's creation in 1947, the only established institution that the country inherited was the British-trained army.[1] An underdeveloped country with scarce resources inherited, what Alavi called, 'an overdeveloped army.' The military, thus, was the only organized state entity with the ability to resolve issues triggered by political conflicts between underdeveloped civilian bodies.
This greatly politicized the military, especially in a country that was almost immediately impacted by deep ethnic schisms. Pakistan had two wings. West Pakistan was ethnically diverse, having four main ethnic groups – the domineering Punjabi; the Sindhi; the Baloch and the Pashtun — and the Mohajir community. East Pakistan, on the other hand, had a Bengali majority.
October 1958: Ayub takes over.
Ayub Khan pledged to build a Pakistan which would be empowered by a robust economy, a strong army, and inspired by a modern and progressive Islam. He launched a scathing critique of the concept of parliamentary democracy. He rejected it, claiming that it was not 'suited to the genius of the people of Pakistan.'[2] As an alternative, he introduced a complicated presidential form of government ('Basic Democracies'). After being 'elected' as president through this system, Ayub promoted himself to Field Marshal.
In 1962 a new constitution was penned which enshrined Ayub's Presidential form of government as the country's dominant political system. Riding on the apparent successes of his regime's economic policies, Ayub was re-elected as president in early 1965. But during the same year, an ill-advised war against India negatively impacted the country's economy and Ayub's popularity.
By 1968, the regime was facing a popular protest movement. Ayub was accused of practicing 'crony capitalism' and usurping the rights of various ethnic groups. Pushed into a corner by the commotion, Ayub resigned as president in March 1969. He handed over power to then military chief, General Yahya Khan.
The April 1969 issue of the British monthly, The Economist.
A shock to the system
Compared to the paternal figure of Ayub Khan, General Yahya was a more colorful character. A heavy drinker and a lot happier in the company of beautiful women, Yahya, however, was astute enough to do what was necessary to appease an angry polity.
He agreed to hold the country's first direct election. But the results of the 1970 election threw up some complicated problems for the ruling and economic elites of West Pakistan. This was mainly due to what the Yahya regime was made to believe by its intelligence agencies. They had predicted a hung parliament.[3] This would have given the military regime the leverage to maneuver things the way it wanted to in the post-election period. Pakistan still had an 'overdeveloped army' presiding over a country with weak political institutions.
Sheikh Mujeeb-ur-Rahman's Bengali nationalist outfit, the Awami League (AL), swept the election in East Pakistan. It was the country's largest region and had been allotted the most number of national and provincial assembly seats. AL's sweep in East Pakistan alone made it the majority party. The party lamented that the West Pakistan elite had been usurping East Pakistan's economic resources.
In West Pakistan, ZA Bhutto's left-leaning Pakistan People's Party (PPP) won big in the region's two largest provinces, the Punjab and Sindh; whereas the left-wing National Awami Party (NAP) – an amalgamation of progressive Baloch, Pashtun and Sindhi nationalists — shared the honors with the religious Jamiat Ulema Islam (JUI) in Balochistan and the North West Frontier Province (NWFP). JUI was the only religious party that did well at the polls. All other religious outfits were routed.
After the initial shock, Yahya regained some equanimity and asked the new national assembly to meet. He was still hopeful of retaining some influence in the new set-up. But the PPP refused to attend the assembly session. It demanded that AL retract its demand for East Pakistan's provincial autonomy. The PPP that had won the most seats in West Pakistan on a populist socialist manifesto, suddenly found itself on the side of the military-establishment. A delay in handing over the reins of power to AL triggered an outright civil war in East Pakistan.
The New York Times' report on Pakistan's first parliamentary election.
The deadly commotion drew India into the conflict. This greatly aided the militant Bengali nationalists in defeating the Pakistani state and see East Pakistan secede and become Bangladesh. In December 1971, West Pakistan became the only Pakistan. A group of officers forced Yahya to resign[4] and hand over power to ZA Bhutto and his PPP. In 1973 the national assembly passed a new constitution which declared Pakistan a parliamentary democracy.
Between 1972 and 1974, the Bhutto government's policies were a direct outcome of the populist socialist promises made in PPP's manifesto. The second period, 1974-77, saw the regime gradually backtrack and readjust its bearings to the changes in the international arena generated by the 1973 Arab-Israel conflict. As Bhutto navigated Pakistan towards the ever-expanding orbit of oil-rich Saudi and Libyan influence, his regime became increasingly authoritarian.
When the PPP swept the 1977 election, an electoral coalition of religious parties and some center-right anti-Bhutto outfits in the Pakistan National Alliance (PNA) cried foul and accused the regime of rigging the polls. PNA began a protest movement which turned violent. PNA's manifesto had attacked the Bhutto regime's 'socialist policies' and promised that the alliance, if voted to power, would install nizam-e-mustafa (or a system based on Sharia laws).
Bhutto unleashed the military against the protesters and dozens of protesters were killed. But he was forced to begin talks with PNA leaders when some military officers in Lahore refused orders to fire on a group of protesters.[5] Bhutto agreed to investigate the alliance's allegations of rigging and also to close down bars and nightclubs and ban the sale of alcoholic beverages to Muslims.
The military, now under the conservative military general, Zia ul-Haq, who was handpicked by the prime minister in 1976, watched closely from the sidelines how Islamic slogans had galvanized a large number of people to challenge the authority of a powerful prime minister.
In this, Zia saw a way to use the 'Islamic card' to repair the credibility of the military and revive the political influence the institution had lost after the 1971 East Pakistan debacle. Using the turmoil created by the PNA movement as a pretext, Zia toppled the Bhutto regime in a coup and imposed the country's third martial law. In his first address, he promised to turn Pakistan into a 'true Islamic state.'
Soldiers arrest a PNA activist during the anti-Bhutto riots of March 1977. A man can also be seen laying on the road, bleeding.
July 1977: Zia takes over. He claimed there was political chaos in the country and from now on only 'pious' people (later termed as 'Sadiq and Amin') would be allowed to take part in politics.
In 1979, two years after imposing the country's third military regime, and just months before sending Bhutto to the gallows on a dubious charge of ordering the murder of a political opponent, General Zia unfolded the 1979 Hudood Ordinances. The Ordinances contained a set of laws intended to introduce Sharia rule in the country. The same year in October, Zia stressed that 'in Islam there was no provision for Western-type elections.[6]
After the December 1979 Soviet invasion of Afghanistan, the Zia dictatorship was bolstered by massive US and Saudi aid. In 1984, Zia got himself elected as president through a sham referendum.[7] In 1985, he announced the holding of elections but without the participation of political parties.
Consequently Zia managed to formulate a national assembly packed with his supporters. The same year he succeeded in unifying the many factions of the country's founding party, the Muslim League and dubbed it Pakistan Muslim League (PML). But this League was different from Pakistan's founder Muhammad Ali Jinnah's quasi-secular Muslim League and Ayub Khan's 'modernist' Convention Muslim League. The new League became the civilian expression of Zia's 'Islamization program.'
In 1987, accusing his own handpicked Prime Minister, Muhammad Khan Junejo, of undermining the Islamization process, Zia dismissed the government and dissolved the assemblies. He announced fresh elections, but again on 'party-less basis.' However, in August 1988, the dictator died in a plane crash. He was replaced by the chairman of the senate, Ghulam Ishaq Khan, who immediately announced an election in which all political parties were allowed to participate.
Democracy returned to Pakistan in November 1988. There were four elections held between 1988 and 1997. This was a volatile period in which two pro-establishment presidents dismissed two PPP and one PML-N governments on charges of 'corruption.'
This period was followed by a military coup in 1999, but one which held a party-based election in 2002. The military, which had regained its political leverage during the Zia dictatorship, was instrumental in influencing policy during all democratic set-ups.
Democracy returns: A huge hoarding of Benazir Bhutto in Faisalabad during the 1988 election.
Nawaz Sharif broke away from PML in 1993 and formed his own PML faction, the PML-N.
In late 1999, accusing political parties of corruption, Gen Pervez Musharraf installed the country's fourth military regime.
READ Getting Sadistic Pleasure From Cutthroat Competition
The 2018 election was the third after the last military ruler, General Pervez Musharraf, was forced to resign in early 2008. The center-right party, the Pakistan Tehreek-e-Insaf (PTI) headed by the former Pakistan cricket captain, Imran Khan, bagged the largest number of seats. It won 116 national assembly (NA) seats out of a total of 272. However, he failed to even win a simple majority and had to form a coalition government with various smaller parties and 'independent' candidates.
The centrist Pakistan Muslim League-Nawaz (PMLN) that had swept the 2013 election with 126 seats, came second with 64 NA seats. The center-left Pakistan People's Party (PPP) grabbed 43, ten more than its tally of 33 in 2013.
The 2018 NA and PA election results.
Almost all parties, except the PTI, alleged that the elections were rigged in favor of the PTI. They alleged that the military-establishment, the higher judiciary and the Election Commission of Pakistan (ECP) worked in tandem 'to assure a PTI win.[8]
Indeed, some glaring irregularities in this context did come to light, but the results were not that far off from the ones predicted by almost all major opinion polls held in the months leading up to the elections. Most of these polls had predicted a neck-to-neck contest between PML-N and PTI. That's why some observers believe that it was not PTI's victory that made the election seem controversial, but the possibility that the party might have been 'gifted' an extra 10 to 15 seats in addition to the 90 to 95 it was predicted to win.
Most opinion polls predicted a neck-to-neck competition between PML-N and PTI.
The PTI was formed by Imran Khan in 1995-96. He had enjoyed a life of a celebrity sportsman and 'playboy'[9] before retiring from cricket in 1992. After retirement, he went through a spiritual transformation of sorts, becoming a 'born-again Muslim.' PTI did not gain any mentionable momentum till 2011, but Khan was able to turn himself into a political brand through regular appearances on TV talk shows and his tirades against corruption.
In 2013, the PTI had won just 27 NA seats. The bulk of them were won in the Pashtun-majority province, the Khyber Pakhtunkhwa (KP). PTI, which had been able to form a provincial government in KP in 2013, swept KP in 2018, winning 67 of KP's 99 provincial assembly (PA) seats and majority of the province's NA seats.
KP is seen as an electorally fickle province. It was dominated by the left-wing National Awami Party (NAP) and the right-wing Jamiat Ulema Islam (JUI) during the 1970 election. Then, between 1988 and 1997, it bounced between the PPP, PMLN and the Pashtun nationalist outfit, the Awami National Party (ANP).
In the 2002 election, held during the General Musharraf dictatorship and shortly after the US attack on then Taliban-ruled Afghanistan, KP largely voted for an alliance of right-wing religious parties, the Muttahida Majlis-e-Amal (MMA) which managed to form a provincial government here.
Bordering Afghanistan, KP had already been impacted by the Afghan Civil Wars of the 1980s and 1990s and the rise of Taliban in 1996. Despite having an Islamist provincial government, KP faced the brunt of the terror attacks perpetrated by Al-Qaeda (AQ) cells in Pakistan between 2004 and 2006. In 2007, as the Musharraf regime was able to somewhat curb AQ activities in the country, an amalgamation of militant Islamist and Sunni sectarian groups formed the Tehreek-e-Taliban Pakistan (TTP). It was headquartered in Pakistan's rugged tribal areas which lay between KP and Afghanistan.
Ravaged by AQ and TTP attacks on civilian and security targets, the electorate in KP voted out the MMA in the 2008 election, and voted-in the secular ANP. ANP managed to form the next provincial government here. But attacks by the TTP in KP witnessed a manifold increase. Numerous ANP leaders were assassinated by the TTP before KP voters switched again and voted for the PTI in 2013.
Two main factors contributed the most in helping PTI sweep KP in 2018. TTP attacks greatly reduced during PTI's provincial government here between 2013 and 2018. The irony is that the decrease in TTP terror attacks was achieved by an unprecedented military operation that the PTI had actually opposed.
The operation, started in 2014, was initiated by then Army chief, General Raheel Sharif, who persuaded the PML-N government and the parliament to green-light a widespread military operation against the TTP. PTI chairman, Imran Khan, had maintained that 'Pakistan was fighting America's war'[10] and that peace could be brokered with the TTP through negotiations.
So the PTI regime in KP became one of the main beneficiaries of a military operation that it had originally opposed. The second major factor that helped PTI retain voter preference in KP was the police reforms that the PTI provincial government had initiated in the province. These effectively depoliticized recruitment in KP's police department, improving its performance.[11]
PTI swept the 2018 election in KP.
The MMA that had disbanded after its loss in 2008, regrouped in 2018 and was expected to give PTI a tough fight in KP's more conservative constituencies. But it too was swept aside by the PTI wave in the province. In early 2018, the PTI government in KP had 'donated' millions of rupees to a seminary run by the intransigent Deobandi-Sunni cleric, Sami ul-Haq.[12] This gesture, undertaken in the name of 'madrassa reform,' was able to help PTI usurp the JUI and JI vote-banks in KP.
The country's southern-most province, Sindh, on the other hand was swept by the PPP. The center-left party has won five national elections since 1970, but ever since 1988, its national vote-bank has been gradually decreasing.
However, it has remained intact in the Sindhi-majority areas of the Sindh province. Only thrice has the PPP failed to form a provincial government in Sindh in the ten elections held in the country since 1970. In 2018, the PPP once again won the bulk of Sindh's NA seats and 74 of the province's 130 PA seats. But as always, the situation in Sindh's (and Pakistan's) largest city, Karachi, was entirely different.
Karachi is the country's most ethnically diverse city. Unlike Sindh's other cities, Karachi does not have a Sindhi-speaking majority. The Urdu-speaking Mohajirs are the largest 'ethnic' community in the city,[13] followed by the Pashtun, the Punjabi/Siraiki, Baloch and Sindhis.[14]
Between 1970 and 1988, Karachi's Mohajir majority had largely voted for mainstream religious parties such as the JI and the Barelvi-Sunni Jamiat Ulema Pakistan (JUP). Yet, Karachi was and is still considered to be Pakistan's most 'liberal' and 'secular' city.[15]
This dichotomy was often explained by analysts by describing the Mohajirs as being socially liberal but politically conservative.[16] The Mohajirs, or Urdu-speaking Muslims who migrated from India to Pakistan in 1947, did not have a natural constituency in Pakistan. Unlike the Bengalis, Sindhi, Pashtun, Punjabi and Baloch, the Mohajirs were not 'people of the soil.'
As ethnic schisms appeared early on in the country, the Mohajirs felt insecure, believing that most political parties in the country were dominated by one ethnic group or the other. The Mohajirs' proclivity towards the religious parties was almost entirely based on the perception that these parties had stood for non-ethnic Islamic universalism.
In 1986 when deadly riots broke out between Karachi's Pashtuns and the Mohajirs, former student leader, Altaf Hussain, launched the Mohajir Qaumi Movement (MQM). He described the Mohajirs as a distinct ethic group. MQM's ideologues also began to express the Mohajirs' new political disposition through the community's inherent social liberalism. MQM became one of the most overtly secular parties in the country.
The party almost immediately struck a chord with Sindh's Mohajirs. It won every election in Karachi between 1988 and 2013. This, despite the fact that the state launched at least three military and police operations against what were described as the party's 'militant wings.'
But from 2015 onwards, the party began to disintegrate, due to severe in-fighting. In 2017 it broke into three factions, the largest being MQM-Pakistan (MQM-P).
In 2018, MQM faced its first defeat in Karachi ever since the party's inception. Out of Karachi's 21 NA seats, PTI won 13, and 21 PA seats. The remaining went to MQM-P, PPP and the Tehreek-e-Labaik-Pakistan (TLP). The PPP faced a major upset in its Karachi stronghold of Lyari — one of the largest working-class and impoverished areas of the city, mostly populated by Baloch and Katchi speakers. Before 2018, PPP hadn't lost an election here since 1970.
In 2018 PTI handed MQM its first major defeat in Karachi. The MQM had not lost an election in the city since 1988.
The new entrant TLP surprised everyone when it managed to bag 2 PA seats in Karachi. TLP was formed in 2016 by groups of radical Barelvi-Sunni Muslim clerics. The outfit materialized in the Punjab as a reaction to the execution of Mumtaz Qadr — the man, who, in 2011, had gunned down former Governor of Punjab, Salmaan Taseer, after accusing him of committing blasphemy. Majority of Pakistani Sunni Muslims are Barelvi.
The Barelvi Sunni sub-sect emerged in South Asia in the late 19th century. It is a fusion of the esoteric Sufism which evolved in India from the 13th century and the many rituals and customs that the Muslims of the region adopted from the pre-Islamic faiths existing in South Asia.
It is thus a more populist strand of South Asian Islam compared to the region's other Sunni strands, such as the Deobandi and the Ahl-e-Hadith. Historically, the Barelvi and the Deobandi have been antagonistic towards each other. The Barelvi are also hostile towards external Sunni sub-sects such as the Ahl-e-Hadith.
READ Never Mind #NawazLeaving, Imran Khan Is Here To Stay
But the Barelvi have never been an organized lot. The JUP used to be the largest Barelvi religious party, but by the 1990s, it had splintered. The Barelvi do not have a jihadist doctrine or tradition.[17] Their radicalism mainly stemmed from what they believed was Saudi Arabia's funding of radical Deobandi and Ahl-e-Hadith groups in the 1980s.
In 2009, the United States funded the time's largest Barelvi group in Pakistan, the Sunni Ittihad Council,[18] which was opposing the TTP. However, what was missed by the US was the fact that, indeed, the Barelvi were opposed to the TTP, but the radical Barelvi see themselves as the protectors of Pakistan's controversial blasphemy laws (enacted by Zia).
The TLP is the most radical Barelvi outfit to emerge in Pakistan. During the 2018 election it received the sixth largest number of votes across the country. Much of its following comes from the lower-middle-class segments in the cities and towns of Punjab and Karachi.
Analysts believe the votes that TLP received in these areas were largely protest votes, because TLP's charismatic and somewhat eccentric cleric-leader, Khadim H. Rizvi, does not offer much other than colorful tirades against those who want to undo or even reform the country's blasphemy laws.
In Karachi, for example, many lower-middle-class Mohajirs who are mostly Barelvi, voted for the TLP to register their disgruntlement against the disoriented and squabbling leadership of the MQM.
TLP also won a PA seat in Lyari. Here many Baloch and Katchi voters cast their votes for TLP as a reaction to the PPP provincial government's mishandling of the street gang wars that decimated the area between 2008 and 2014. PTI too won seats from Lyari.
In Karachi, TLP mainly attracted the lower-middle-class Mohajir votes. This opened up the traditional MQM vote-bank with much of it tilting towards PTI and TLP. MQM-P could bag just 6 NA seats in Sindh.
Just as they had done in 2013, bulk of Karachi's middle and upper-middle class votes were again cast for PTI. More than Khan's allusions to Islam, it is his impassioned stands against corruption which attracted voters from these classes. They can be explained as a blocked elite that enjoys considerable economic influence but believes its entry into politics is being blocked by the PPP and PML-N.
The radical Barelvi outfit, the TLP, usurped chunks of lower-middle-class Mohajir and Katchi-speaking votes in Karachi.
Sindh beyond Karachi and parts of Hyderabad, was taken whole by the PPP. An electoral alliance of some conservative Sindh-based parties and Sindhi nationalist groups, the Grand Democratic Alliance (GDA), failed to dent the solid PPP vote bank here.
For decades the Sindhis outside Karachi have come to know and trust the PPP as the party that has become a bridge which helps them get access to the benefits of national-level politics and economics. PTI invested a lot of effort in northern Sindh by co-opting some heavyweight anti-PPP politicians, but they were defeated. PTI could not make any inroads in the province outside of Karachi. Another reason for this is the fact that most Sindhis perceive the PTI as a Punjab-centric party, just as they do the PML-N.
Outside Karachi, the PPP once again swept the election in Sindh.
Much of PTI's electoral efforts went into winning big in the Punjab. Being Pakistan's largest and most populated province, it has the largest number of NA and PA seats. If a party is able to sweep Punjab, it can form a national government even without doing so well in other provinces.
Between 1970 and 1988, Punjab had been an electoral bastion of the PPP that had swept it in 1970 and 1977. Even though the party again won here in 1988, the percentage of its votes in the province fell from being 41.7% in 1970 and a whopping 61.7% in 1977 to 39.4% in 1988. During the 1997 election, the percentage plummeted to 22.2%.
In 1985 when Zia reengineered the PML, his dictatorship distributed large amounts of money among the NA and PA members of the PML. The money was handed over in the name of 'development funds.' Punjab was flush with such funds which not only accelerated the growth of a new middle and trader class here, but brought forth a new generation of conservative but enterprising politicians in the province.
Secondly, PML when it became part of a right-wing anti-PPP alliance in 1988, denounced the PPP as a Sindhi party. During the 1988 and 1990 elections, PML used the slogan 'Jaag Punjabi jaag' (wake up, Punjabis) to suggest that a Sindhi party was undermining the interests of the Punjabis.
PML broke into three factions in 1993. The largest of these was Nawaz Sharif's PML-N. But like PML, this faction too remained pro-establishment, and continued to pander to the province's new middle, trader and lower-middle-classes that had emerged in the 1980s.
However, in 1997, even though PML-N's vote bank in Punjab continued to climb, Nawaz, during his second term as PM, decided to break away from the establishment's orbit. This saw him being toppled in a military coup in 1999.
From 2008 onward, PMLN's ideological orientation gradually began to move more towards the centre. This helped the party to limit the sympathy wave the PPP experienced after the assassination of Benazir Bhutto in 2007.
But as PML-N continued to move towards the centre, and the PPP's vote-bank in the Punjab crashed to just 10.2% in 2013, PTI began to manoeuvre itself as an alternative by adopting some erstwhile populist positions of the old PPP and the Islamist rhetoric of the PML-N of the 1990s.
In the Punjab PTI basically filled the vacuum created by PML-N's gradual ideological shift. For example, it was during the recently concluded PML-N government that Mumtaz Qadri was hanged. PTI had remained quiet on the execution, and this, in turn, saw PML-N's religious Barelvi voters opting to vote for TLP in 2018.
This indirectly aided PTI to defeat PML-N in various constituencies of the province. Nevertheless, PML-N still managed to win more seats here than the PTI. It won 129 PA seats in the Punjab compared to PTI's 123. But with smaller parties, PTI has managed to form albeit shaky provincial government in the province.
Tensions between PML-N and PTI supporters continue to intensify, especially in North and central Punjab regions which, ever since 1997, have largely voted for centre-right parties. The perception that PML-N had clashed with the military-establishment, lost the party votes in these regions where voters closely identify with the military. Central Punjab on the other hand remained firmly with PML-N, whereas the more impoverished Southern Punjab that had largely voted for the PPP in the 1990s, before switching to PML-N in 2013, now turned towards PTI.
The election in the country's rugged and arid province of Balochistan threw up a surprise when a pro-establishment Baloch party, the Balochistan Awami Party (BAP) won the most seats here. The left-wing NAP had swept the elections here in 1970. But the provincial government that the party formed was dismissed by ZA Bhutto whose regime accused NAP of aiding Baloch separatists.
The province witnessed an armed Baloch uprising till 1977. Balochistan has two main ethnic groups, the Baloch and the Pashtun. During the post-1988 elections, the Baloch have largely voted for various Baloch nationalist parties, whereas the Pashtuns have either voted for the two Pashtun nationalist outfits, the ANP and the Pakhtunkhwa Awami Party (PkAP), or the Deobandi JUI. PML-N and PPP also have vote banks here.
The province has witnessed a lot of violence recently, mainly due to attacks on Shia Muslims by extremist Sunni outfits and attacks on Punjabis and security forces by militant Baloch nationalist organisations.
BAP offered a way out by fusing watered-down Baloch and Pashtun nationalist sentiments with overt Pakistani nationalism. BAP agreed to become a coalition partner of the new PTI government in the centre.
The newly-formed BAP won big in Balochistan.
The Minorities
Even though no detailed findings have come to light about who Pakistan's religious minority groups voted for in 2018, but some newspaper reports did allude that the Hindus of Sindh largely voted for the PPP, whereas the Hindus and Christians of Karachi mostly voted for the PTI.
In Karachi, the Hindus and the Christians had been MQM voters ever since the controversial system of separate electorates (introduced by Zia) was done away with by Musharraf in 2002. In the rest of Sindh the Hindus seemed to have overwhelmingly voted for the PPP.
In the Punjab, the region's large Christian minority vote seemed to have been split between PML-N and PTI. But many leaders of the Christian community are on record to lament that both the parties have offered little to curb attacks on Christians by radical Muslim groups and clerics.
The results of the 2018 election are a daunting reflection of a society that remains to be severely polarised on various political, economic and religious issues.
[1] Hamza Alavi: The State in Post-Colonial Societies, New Left Review (July/August 1972) p.74
[2] A M. Ahmada: End of a Betrayal and Restoration of Lahore Resolution (Khosroz Kitab Mahal, 1975) p.303
[3] Feroz Khan: Eating Grass: Making of the Pakistani Bomb (Stanford University Press, 2012) p.74
[4] R Sisson, LE Rose: War and Succession: Pakistan, India and the Creation of Bangladesh (University of California Press, 1991) p.235
[5] What Goes Around: The Movement Against Bhutto, DAWN (August 31, 2014)
[6] Pakistan 1979: Back to Square One: WL Richter; WE Gustafson (Survey of Asia Vol:20, February 1980) p.192
[7] Ian Talbot: Pakistan: a Modern History (St. Martin's Press, 1998) p.261
[8] PMLN Joined Assemblies to Protest Against Rigging, Manipulation Against Election 2018, The News (August 15, 2018)
[9] Imran Khan's Playboy Image Was Forged In England, The Times (July 28, 2018)
[10] Imran Khan's interview with ARY News (February 4, 2018)
[11] PTI set to replicate police reforms in Punjab, The Nation, (August 12, 2018)
[12] Imran defends funding for Sami's madrassa, Daily Times (February 25, 2018)
[13] Karachi Population. (2017-10-17). Retrieved 2018-09-18, from http://worldpopulationreview.com/world-cities/karachi/
[14] Khaled Ahmad: The Pakhtun In Karachi, The Express Tribune (August 28, 2010)
[15] S. Inskeep: Instant City: Life and Death in Karachi (Penguin Books, 2012) p.284
[16] S Shafqat: MQM as Liberal Savior of Karachi, Asian Survey (September/October, 2017)
[17] Mujeeb Ahmad: Dawat-e-Islami: A Revivalist Movement of Barelvis, Journal of South Asian & Middle Eastern Studies (Winter, 2011)
[18] US aid to SIC backfires, Express Tribune (January 12, 2012)
Victoria Hall Of Peshawar: A Museum For A Crossroads
2.3 Out Of 3.6 Million School-Age Children Out Of School In Balochistan
Illegal Annexation Of Kashmir: Is India's Democracy Dead?
Nadeem F. Paracha
Nadeem Farooq Paracha is a Pakistani journalist, author and cultural critic. He can be reached at [email protected]
Election rigging 2018
Nadeem F Paracha
Nadeem F Paracha 2018 elections
Pakistan 2018 elections
Pakistan elections 2018
PTI victory in 2018 elections
Peshawar's Official Rat Killer
9 freedoms guaranteed by the State of Pakistan
The Growing Toxicity And Hatred In Public Discourse
Foqia Khan 17 Jan 2020
Rule Of The Electable
Muhammad Ziauddin 16 Jan 2020
Nadeem F. Paracha 15 Jan 2020
JNU Violence Shows India's Secularism Is In Tatters
Justice Markandey Katju 14 Jan 2020
How Law And Literature Can Be Allied To Promote Empathy
Ayesha Tariq and Janhvi Prakash 13 Jan 2020
Crime & Justice, News
Governane, News, Politics
News, Tourism
Couple Postpones Marriage After Groom's Father, Bride's Mother Elope
News delivered to your inbox.
Categories Select Category Analysis (1,030) Arts & Culture (33) Film (10) Literature (3) Seasons (5) Satire (3) Book Review (15) Democracy (44) Development (1) Diplomacy (32) Economy (39) Budget 2019 (2) IMF Programme (3) Education (14) Entertainment (9) Review (3) Environment (7) Game Review (1) Gender (31) #MeToo (2) Satire (4) Governance (29) Health (7) History (27) Human Rights (58) Justice (30) Media (21) People (11) Politics (312) Diplomacy (26) International (37) Terrorism (18) War & Conflict (32) Religion (24) Sports (4) Technology (2) Youth (9) cartoons (22) Categorized (179) Citizen Voices (273) Arts and Culture (15) Book Review (1) Poetry (1) Climate Change (4) Democracy (8) Economy (5) Education (19) Gender (11) Governance (9) Health (11) Heritage (1) History (5) Human Rights (22) Justice (9) Media (3) People (6) Places (1) Poem (1) Politics (37) War & Conflict (3) Religion (16) Science (2) Short Story (1) Sports (7) Wildlife (3) Women Rights (1) Youth (4) Editor Picks (172) Editorial (32) Education (1) Featured (1,793) Beauty (1) Entertainment (4) Health (2) Lifestyle (6) Recipes (1) Features (486) Arts & Culture (104) Books (15) Business (1) Careers (1) Climate Change (9) Democracy (37) Economy (10) Education (13) Entertainment (2) Film (7) Food (8) Gender (24) Governance (5) Health (35) Mental Health (9) History (69) Human Rights (24) Justice (7) Law & Order (6) Media (8) People (34) Places (16) Politics (104) International (2) Interview (5) Satire (7) Religion (24) Satire (1) Science (1) Sports (13) Technology (4) Apps (1) Terrorism (9) Youth (5) Infographics (11) Lifestyle (151) Entertainment (22) Health (5) News (3,291) Agriculture (5) Arts & Culture (31) Business & Economy (118) Crime & Justice (134) Ecology (7) Economy (32) Education (22) Entertainment (104) Environment (34) Food (7) Gender (55) Governane (129) Health (69) History (12) Human Rights (230) Lifestyle (30) Media (88) National (1) Politics (716) Diplomacy (62) International (64) Religion (44) Science (14) Sports (87) Technology (20) Terrorism (55) Tourism (4) Weird (6) People who wish to lose weight (1) Social Issues (1) Videos (1,024) Arts and Culture (69) Crime & Justice (19) Democracy (227) Economy (60) Education (36) Environment (43) Food (16) Gender (66) Governance (103) Health (55) Heritage (23) History (33) Human Rights (141) Innovation (9) Justice (30) Law and Order (60) Lifestyle (16) Media (70) People (85) Places (37) Politics (241) Terrorism (14) Religion (87) Social Issues (32) Sports (30) Technology (4) Wildlife (6) Women Rights (8) Youth (20) Viral (1) women rights (1) عوام کی آواز (6) ویڈیوز (108)
Acceptance of any contribution, gift or grant is at the discretion of the Public Broadcasting Network (PBN). The Public Broadcasting Network (PBN) will not accept any gift unless it can be used or expended consistently with the purpose and mission of the Public Broadcasting Network (PBN).
The Public Broadcasting Network (PBN) will refrain from providing advice about the tax or other treatment of gifts and will encourage donors to seek guidance from their own professional advisers to assist them in the process of making their donation.
The Public Broadcasting Network (PBN) will accept donations of cash or publicly traded securities. Gifts of in-kind services will be accepted at the discretion of the Public Broadcasting Network (PBN).
Certain other gifts, real property, personal property, in-kind gifts, non-liquid securities, and contributions whose sources are not transparent or whose use is restricted in some manner, must be reviewed prior to acceptance due to the special obligations raised or liabilities they may pose for Public Broadcasting Network (PBN).
The Public Broadcasting Network (PBN) will provide acknowledgments to donors meeting tax requirements for property received by the charity as a gift. However, except for gifts of cash and publicly traded securities, no value shall be ascribed to any receipt or other form of substantiation of a gift received by Public Broadcasting Network (PBN).
The Public Broadcasting Network (PBN) will respect the intent of the donor relating to gifts for restricted purposes and those relating to the desire to remain anonymous. With respect to anonymous gifts, the Public Broadcasting Network (PBN) will restrict information about the donor to only those staff members with a need to know.
The Public Broadcasting Network (PBN) will not compensate, whether through commissions, finders' fees, or other means, any third party for directing a gift or a donor to the Public Broadcasting Network (PBN).
Saad Malik September 27, 2018
Naya Daur © All Rights Reserved.

redpajama_set_name: RedPajamaCommonCrawl


Our second annual BoF 500 print edition examines some of the overachieving Polymaths & Multitaskers making outsized contributions to the global fashion industry. It's not out until September 22, but is available for pre-order now.
LONDON, United Kingdom — Today, we are thrilled to release the cover of our next special print edition, featuring a hyperreal image of Karl Lagerfeld, specially created for BoF by Maurizio Cattelan and Pierpaolo Ferrari of Toiletpaper. Now in the sixth decade of a prolific career, Lagerfeld is fashion's consummate polymathic multitasker and thus a perfect cover star for our Polymaths & Multitaskers issue, which profiles an exciting cast of multi-talented individuals who are making outsized contributions to our global industry.
The issue will be available on September 22 to coincide with the launch of the BoF 500 2014, recognising the people shaping the global fashion industry.
So what do these Polymaths & Multitaskers have in common? For one, they are global citizens who have left to work and study outside their home countries, often at a very young age. Amongst them are Karl Lagerfeld, a multitasking octogenarian who left Germany, aged 14, to go to school in France; Mukesh Bansal, who spent time in Silicon Valley before pioneering fashion e-commerce in his native India; and Tim Blanks, a New Zealand-born fashion editor who has lived and worked on three continents.
Naturally, they are also smart and well-educated. A precocious Tim Blanks attended university at the age of fifteen. At school, Mario Testino was always first or second in his class, studying economics in university prior to pursuing his love for photography. And both Caroline Issa and Pierre-Yves Roussel studied business at the prestigious Wharton School at the University of Pennsylvania, becoming management consultants before entering fashion.
But most of all, their success seems to stem from their unique positions at the intersection of different skills and perspectives, which enables them to do multiple things and bring fresh ideas and thinking to their work.
Mark Parker, a product designer who joined Nike in 1979, has risen to become the chief executive of the global sportswear giant, which earned a staggering $27.8 billion in revenue in fiscal 2014. Knowing how to balance the 'left-brain/right-brain' elements of his work has been central to Parker's — and Nike's — success. There are also top-performing executives who have done it the other way around, starting on the business side but learning about design and creativity. Mr Roussel came to fashion with a limited understanding of fashion design. But over the past decade, he has developed an appreciation for the creative process, developed trusting relationships with some of the industry's most talented designers and revitalised a portfolio of stagnant brands at LVMH.
Then there's the creative duo Toiletpaper. After retiring from a hugely successful career in the contemporary art world, where his works can sell for millions of dollars, Maurizio Cattelan took one look at imagery and advertising in fashion and saw an opportunity to do something completely different. Together with photographer Pierpaolo Ferrari under the moniker of their provocative magazine Toiletpaper, the duo have injected unexpected humour and energy into fashion imagery, producing work that stands out from the homogenous, uniform images seen everywhere else.
We hope you enjoy our latest special print issue, which is available for pre-order now. And stay tuned for the launch of the full BoF 500 on September 22.
The Polymaths & Multitaskers issue, out on September 22, will be sold exclusively at shop.businessoffashion.com and select retailers around the world.


text:
package org.opentosca.toscana.core.parse;

/**
 Indicates that a tosca template violates the TOSCA Simple Profile 1.1 specification
 */
public class ToscaTemplateException extends RuntimeException {

    public ToscaTemplateException(String message) {
        super(message);
    }
}

redpajama_set_name: RedPajamaGithub


Moving home can be one of the biggest decisions in our life. Once you have made the decision to move you may want to speak to one of our advisors to check over your income and affordability to try and establish a budget for your new home.
If you have a property to sell you will need to get some market appraisals from estate agents. The choice of local or online estate agents is up to you although we have seen good results and good service with the fixed fee online agents who generally offer robust systems and late opening telephone lines.
Once you have a buyer for your home, its then time to find your next home. The obvious choice for this is to search the online portals such as Rightmove, Zoopla etc.
Once you have viewed a home and decided you would like to make an offer, you will need to speak with us again to see if it is appropriate to obtain an Agreement In Principle (Mortgage in Principle) before making the offer.
Once your offer is accepted, we will arrange a meeting with your advisor to start the mortgage application process and collect the required documentation.
Before we help you choose a specific deal, you may want to understand more about what types of mortgage are available.
This brief (but not exhaustive) summary may help.
Tracker rate – Your monthly payment fluctuates in line with a rate that's equal to, higher, or lower than a chosen Base Rate (usually the Bank of England Base Rate). The rate charged on the mortgage 'tracks' that rate, usually for a set period of two to three years. You may have to pay a penalty to leave your lender, especially during the tracker period. A tracker may suit you if you can afford to pay more when interest rates go up – and you'll benefit when they go down. It's not a good choice if your budget won't stretch to higher monthly payments.
By far the most commonly used type of deal is fixed rates. Most commonly for either 2,3 or 5 years (others available).


text:
Success Stories of 2022 – Journal of Systems Thinking
December 23, 2022 *
As we approach the new year, we would like to continue highlighting some of the successful collaborations of 2022, which will serve as inspiration for our work in the coming year and future partnerships in 2023.
Let us celebrate open science and open peer review today by revisiting the Journal of Systems Thinking collection.
Open Peer Reviewing on Systems Thinking
The Journal of Systems Thinking (JoST) is the first and only open-access post-publication peer-reviewed (PPPR) journal dedicated to basic scientific research, innovation, and public understanding in the areas of Systems Thinking (cognitive complexity), Systems Mapping (visual complexity), Systems Leadership (organizational complexity), and Systems Science (ontological complexity).
Authors interested in the field of Systems Thinking are invited to submit a manuscript to the open peer review system for JoST, which will be posted as a "preprint" for open peer review and discussion. Editors and authors can then invite expert reviewers, including members of the ScienceOpen community, to review and comment on preprints, which have their own Crossref DOIs and can be easily cited and tracked.
Authors can then revise their work in response to reviewer comments, and the article's history allows readers to track its progress through to final publication. The final decision for publication lies with the Editors of JoST.
Once an article is accepted it will be professionally published and distributed to a range of services by ScienceOpen, including long-term archiving through CLOCKSS, Google Scholar metatags, and support with indexing services for the widest possible distribution.
We invite you to start reviewing today some of the preprints in the JoST and celebrate ScienceOpen's built-in infrastructure for open, post-publication peer review, which has been used and improved since 2014.
U.S. Air Force Career Field Management : At the Intersection of Futures Studies and Systems Thinking
A Systems-Based Analysis of Human Violence
Circular Economy in Global Apparel Supply Chains: Restructuring the Fashion System using Agent Based Approach (ABA)
Cornell University Response to COVID-19 Pandemic: Cornell's COVID-19 Response Strategy Using the Agent Based Approach (ABA)
The Military-Climate Change System: A Case Study Using the Agent Based Approach (ABA)
Join ScienceOpen in 2023!
We are constantly upgrading our digital infrastructure, and we are very glad to see our network expand even further in 2023, with exciting new prospective publishers joining.
Tags: journal of systems thinkingOpen Peer ReviewOpen Sciencepeer review managementpost publication peer reviewResearchsystems sciencesystems thinking
Previous: Previous post: Success Stories of 2022 – AK Journals
Next: Next post: Success Stories of 2022 – Genome Integrity


Today is all about you. Are you the hub of your business? Attribute eight of your sellability report is called Hub & Spoke. Your score measures how well your business could thrive without you at the hub of all its activities.
More Time Off vs Higher Business Value?
Believe or not, taking more time off may actually be the best way to increase the value of your company. Here's an easy test to see how you're doing: If you were out of action for three months and unable to work, would your business keep running smoothly? It's a fact, the more your staff and customers need you, the less valuable your company will be to a potential new owner.
Statistics indicate companies that could perform well without their owner for a period of three months, are 50 percent more likely to be acquired when compared to more owner-dependent businesses. Maybe it's time to You-Proof your business, so you can take more time off, enjoy more personal freedom and build a more valuable company.
← 2) How Can I Make My Company Worth More?


TYLER, Texas — City officials voted to allow a technology company to test a drone system that could be used by first responders.
KLTV reported that Phirst Technologies will conduct testing of its automated drone first response system, which could be dispatched by 911 operators.
The drone could also be used in rescues.
"These drones can be a game changer for locating someone who may be lost in a field or a child that's wandered off from their parent," Tyler Fire Department Chief David Coble said.
Coble said that if the program goes as expected, 10 drones will be stationed in the county through a lease program with Phirst Technologies.


text:
Survivors offer insight, encourage awareness
Posted on October 13, 2016 by benningnews	Leave a comment
By Danielle Davis, Bayonet & Saber /
FORT BENNING, Ga., (Oct. 5, 2016) — The Fort Benning Army Substance Abuse Program sponsored a presentation Sept. 29 in McGinnis-Wickam Hall to raise suicide prevention awareness.
Stephen Akinduro and veteran Phil Corbett, outreach specialists for the Columbus branch of the National Alliance on Mental Illness, were the guest speakers. As part of their presentation, Akinduro and Corbett often referred to their accompanying interactive video.
Phil Corbett, an Outreach Specialist with the Columbus branch of NAMI, shared his story Sept. 29 during a presentation sponsored by the Fort Benning Army Substance Abuse Program. (Photo Credit: Danielle Davis)
"During the 'In Our Own Voices' presentation, we tell our stories of survival and how we got to where we are right now," said Akinduro.
"One of my biggest successes was becoming a NAMI facilitator," added Corbett. "It got me talking about my problems and that was the biggest thing. It put me in a position to help others."
Akinduro revealed that in 1993 he attempted suicide. "Before then, I really didn't know how to describe what I was going through. There was just this constant feeling of emptiness on the inside," he said.
According to Akinduro, it was as if someone had sucked out all of the hope that he had, leaving him just enough to survive but not enough to enjoy life. He admitted that he didn't want anyone to know about his suicide, even going so far as to ask his friend who drove him to the hospital not to tell anyone.
"I didn't want anyone to know I was having problems either," added Corbett.
During his dark days, Akinduro said that he would isolate. "I didn't want to be around people. I'd become irritable," he added.
Corbett revealed that during his dark days he would act out self-destructively. "In my younger days, I would cut myself," he said.
"I was dealing with a lot of anger issues with my parents separating," Corbett added. "They divorced when I was like four and I never really got through that. It caused a lot of problems growing up."
Akinduro was eventually diagnosed with major depression. His current diagnosis is noncombat post-traumatic stress, bipolar type 2.
Corbett was also diagnosed with post-traumatic stress disorder and borderline personality disorder.
A lot of Soldiers feel as though there's no one to talk to. There's a lot of stigma attached to reaching out for help. To talk about it means you're weak or it's a career ender, he said.
Corbett hopes that more Soldiers will speak out about their struggles.
For more information about the Columbus branch of NAMI, visit http://namicols.org/. For more information about ASAP, visit http://www.benning.army.mil/garrison/dhr/asap/.
tagged with Army Substance Abuse Program, sucide, Suicide Prevention, suicide prevention awareness, Suicide Prevention Month


LONDON (Reuters) - A rare original charter from the reign of King John, complete with its royal seal, has been discovered by chance in County Durham northern England.
Dated 26 March 1200, exactly 819 years ago, the charter was issued in the city of York and confirms the transfer of ownership of two hamlets in Durham.
Fewer than a dozen original charters are known to have survived from the first year of King John's reign.
It was carefully prepared and written in what is known as a court hand, likely belonging to a professional scribe, who might have been a member of the King's government department or Chancery.
The discovery was made by Benjamin Pohl, a Senior Lecturer at the University of Bristol.
"It's like a portal, a window into the past that you can touch," he said.
Pohl discovered the charter while carrying out unrelated research at Ushaw College Library, one of the core collections forming part of the Durham Residential Research Library, managed by Durham University.
King John, who reigned between 1199 and 1216, is best known for having signed another charter, the Magna Carta, in 1215. One of the most important manuscripts in English history, the Magna Carta is a charter of citizens' rights curbing the arbitrary power of medieval kings which among other things guaranteed the right to a fair trial.


text:
ArtistsExhibitionsPublicationsInfo
The Bababad Paintings
Stellan Holm Gallery in collaboration with Lisa Jacobs Fine Art is pleased to announce its first solo exhibition with the preeminent New York-based artist William Anastasi. The exhibition will premiere six new paintings from the Bababad Series. This series is inspired by the longest word in James Joyce's novel, Finnegans Wake, as Anastasi explains, Joyce's "frightening beast" of an experimental novel. Like many admirers of the book, it has held an enduring fascination for Anastasi and has found its way into the soul of Anastasi's work and literally onto his canvas. He began the series in the mid-eighties and is continuously working on it to this day. At the end of the series, which is one-third completed, fifty paintings (at roughly two letters each painting) will spell the sound of the fall of man, or the thunderclap expelling Adam and Eve from the Garden of Eden. The word in question is:
"Bababadalgharaghtakamminarronnkonnbronntonnerronntuonnthunntrovarrhounawnskawnloohoohoordenenthurnuk."
Try and say that aloud three times quickly. But wait, is it not more enjoyable to look at each and every letter of the word as Anastasi has magically transformed them into arabesques of pulsating line and color that quiver and float through the visual space of his canvases. "The attraction was to literary genius," says Anastasi. His attraction to Joyce started with The Dubliners and A Portrait of the Artist and ultimately to Finnegan's Wake. During his formative years, Anastasi remembers that he got into the habit of reading aloud, and that act of reading something aloud made it much more meaningful, much more powerful for him, Anastasi says, "I was reading Finnegans Wake aloud at the time and I loved this word which represents, among other things, God's voice." Anastasi goes on to explain, "There's an Irish folkloric tradition that when a man plunges to death the sound which accompanies his fall is the voice of God. This word heralds Finnegan's fall from his scaffold and symbolically propels Lucifer and his followers into hell. It's a sound object, and I guess connects with my sound objects. It's a word about a sound, a word of a sound. I started with sound objects and ended up here doing a painting of a sound." Perhaps to memorialize his 50 year preoccupation with the novel as well as a double homage to his heroes in literature and art, James Joyce and John Cage respectively, Anastasi has turned out a series of paintings as electrifying as a flash of lightning with a simultaneous crash of thunder.
The bold, colorful, larger than life size canvases are created in part by chance, what Anastasi calls "unsighted painting" – painting without consciously looking at the canvas. Anastasi's process involves oil sticks, which make it possible to put color on a surface without choosing the color. In contrast to the abstraction, he creates structure in the form of letters. Anastasi employs the old fashioned transparency method where immense blow-ups of each letter of the word are traced onto the canvas. In the novel, the word is first introduced to the reader on page one. It's the first of ten thunderclaps scattered throughout the novel; each of which has 100 letters. Each painting includes roughly two letters. Sometimes the letters unintentionally form a word, for example "on", "tu" French for "you" and other times the letters visually transmit a sound, like "o" or "er".
The word as image has long fascinated artists and art lovers. If we think back to the history of 20th century art, cubist paintings of Picasso and Braque, with their inclusions of bits of words, instantly come to mind, as do the witty word paintings of Ed Ruscha and the cool joke paintings of Richard Prince. Paintings with text are attractive to the viewer not only because they are enjoyable to look at but they are also engaging to read. Words add an intellectual component to the act of looking at a painting.
Anastasi is recognized as a pioneer of conceptual art. Throughout his career he has worked in every kind of media including sound, and sculpture. His influence on contemporary art to date is significant, but is often overlooked. For example, his curved sculptures predate Richard Serra's Torqued Ellipses and his 1965 piece Beethoven's Fifth Symphony arguably had a profound influence on Eva Hesse's work. Although a recent exhibition of his sound objects at The Leubsdorf Gallery at Hunter College garnered high acclaimed, in New York, he says, "I'm still relatively invisible." As the artist and critic William Powhida predicted, in a Brooklyn Rail review in 2006, "There is no question that Anastasi is a pioneer of conceptualism and that he is deserving of recognition, however belatedly."
William Anastasi was born in Philadelphia in 1933. He studied philosophy and business at the University of Pennsylvania. He has lived and worked in New York since 1962. He had four groundbreaking exhibitions at Dwan Gallery, New York between 1966-1970, one of which will be included in the Dwan gift to the National Gallery opening in 2016. His works are in numerous collections including The Metropolitan Museum of Art, New York, The Museum of Modern Art, New York, the Solomon R. Guggenheim Museum, New York, The Whitney Museum of American Art, New York, The Jewish Museum, New York, the National Gallery of Art, Washington, DC, the Art Institute of Chicago, Chicago and the Walker Art Center, Minneapolis. Anastasi's work has since been shown at Yvon Lambert, Paris (2013); Galerie Jocelyn Wolff, Paris (solo, 2012); Gering & Lopez, New York (2010); the Esbjerg Art Museum, Denmark (retrospective, 2009); Galleria d'arte Emilio Mazzoli (2009) and many other museums and galleries in the U.S. and Europe. In 2013 a retrospective of Anastasi's sound works was on view at the Leubsdorf Gallery at Hunter College, New York. Anastasi's work is currently included in the concurrent exhibitions "Horror vacui" at Gagosian Gallery, Geneva and Gagosian Gallery, Athens.
For further information please contact the gallery at info@stellanholm.com.
Gallery hours: Monday - Friday, 10am - 6pm
www.stellanholm.com
1018 Madison Ave, New York, NY 10075 Tel 212.627.7444 / Fax 212.627.4646 info@stellanholm.com


text:
layout: post
title: "Migrating a PHP 5 App to PHP 7 (Tools & Implementation) - Part 3"
description: "Let's go through migrating a simple PHP 5 app to PHP 7"
date: 2017-02-09 8:30
category: Technical Guide, PHP, Tools
author:
  name: "Prosper Otemuyiwa"
  url: "http://twitter.com/unicodeveloper?lang=en"
  mail: "prosper.otemuyiwa@auth0.com"
  avatar: "https://en.gravatar.com/avatar/1097492785caf9ffeebffeb624202d8f?s=200"
design:
  image: https://cdn.auth0.com/blog/migration/PHPlogo.png
  bg_color: "#312A4C"
tags:
- php5
- php7
- migrate
related:
- 2017-01-20-migrating-a-php5-app-to-php7-part-one
- 2017-02-07-migrating-a-php5-app-to-php7-part-two
---

**TL;DR:** Many PHP applications are still running on PHP 5.x, not ready to take full advantage of the awesome features that PHP 7 offers. A lot of developers have not made the switch because of certain fears of compatibility issues, migration challenges and the strange awkward feeling that migrating will take away a big chunk of their time. In the [first part of this tutorial](https://auth0.com/blog/migrating-a-php5-app-to-php7-part-one) we learned how to set up a PHP 7 development environment. In [the second part of this tutorial](https://auth0.com/blog/migrating-a-php5-app-to-php7-part-two), we discussed extensively about all the new features PHP 7 offers and the language constructs and features that have been either removed or deprecated. This time, we'll show you how you can leverage all the new PHP 7 features when migrating and also the tools that will help to make the process painless!

---

You need to be aware that for the most part, PHP 5.x code can run on PHP 7. In PHP 7, there are some backwards incompatible changes, so applications built with PHP 5.x that use functions and language constructs that have been removed or have the internal implementation changed drastically will spit out errors while trying to run on PHP 7.

## Tools to Aid Migration

One of the most frustating part of our jobs as software developers is having to work on large old codebases. In a situation where you are tasked with migrating a large PHP 5.x application that has probably been in existence for about 10 years, how would you go about it?

The easiest and most obvious way of migrating is to initially clone the app on your local machine, install PHP 7 and run the app. You can walk through the errors and deperaction warnings shown in the terminal, and manually fix them step-by-step by incorporating PHP 7 features. This can be very challenging and time consuming. Why can't we automate this process?

Currently there is no tool out there that performs a 100% automatic conversion of your PHP 5.x codebase to PHP 7, but these tools below will help in making your migration painless.

### PHP 7 MAR

[php7mar](https://github.com/Alexia/php7mar) is a command-line tool that generates reports on PHP 5.x codebase based on PHP 7 compatibility. The reports contain line numbers, issues noted, and suggested fixes along with documentation links.

**Note:** The tool does not fix code. It only gives you reports about all the PHP files in your codebase. Happy fixing!

### PHP 7 Compatibility Checker

[php7cc](https://github.com/sstalle/php7cc) is a command-line tool designed to make migration from PHP 5.3 - 5.6 to PHP 7 really easy. php7cc reports:

* **Errors:** Fatal, Syntax, Notice. These are highlighted in red.
* **Warnings:** These are highlighted in yellow.

### Phan

[phan](https://github.com/etsy/phan) is a static analyzer for PHP that attempts to prove incorrectness rather than correctness. Phan looks for common issues and verifies type compatibility on various operations when type information is available or can be deduced. Phan checks for lots of things including PHP7/PHP5 backward compatibility.

### phpto7aid

[phpto7aid](https://github.com/gisostallenberg/php-to-7-aid) is a tool that is used to identify PHP 5 code that will not work in PHP 7. It tries to aid you as much as possible in resolving these issues, by either providing the exact solution or giving hints on how to solve the issue.

### PhpStorm PHP 7 Compatibility Inspection

[PhpStorm](https://www.jetbrains.com/phpstorm) is a very smart PHP IDE, developed by [Jetbrains](https://www.jetbrains.com).

![PHPStorm](https://cdn.auth0.com/blog/php/phpstorm_debugging.png)
_Source: Jetbrains.com_

PhpStorm 10 comes with a *PHP 7 Compatibility Inspection* tool that can show you exactly what code is going to cause errors if you are running PHP7.

![PHP 7 Readiness](https://cdn.auth0.com/blog/php/PHP7-Readiness-Inline-2.png)
_Source: Jetbrains.com_

The image below shows a typical example of an application that has classes with names that are reserved in PHP 7. Selecting **Run Inspection By Name** option from the **Code** menu, and then selecting the **PHP 7 Compatibility** section will give you results like this one below:

![PHP 7 Readiness Results](https://cdn.auth0.com/blog/php/PHP7-Readiness-Results.png)
_Source: Jetbrains.com_

## Building a PHP5 App

We will build the first simple PHP 5 app very quickly. This is the scope of the app:

* A user will be able to register on the app.
* A user will be able to log into the app.
* A user will be assigned a random Star Wars Code Name.
* A user will be able to log out of the app.

Building this app will require us to set up a database to store the users, write our registration and login code and manage the users session. Now, we won't employ the use of any framework because we don't want any form of overhead. Ordinarily, building this app would take a lot of time and setup but there is a service we can use to eliminate the hassle. Oh, yeah, Auth0 to the rescue!

> Auth0 provides the simplest and easiest to use [User interface tools to help administrators manage user identities](https://auth0.com/user-management) including password resets, creating and provisioning, blocking and deleting users.

### Create and Configure Auth0 Client

First thing we'll need to do is sign up for a free Auth0 account and configure a new client.

> [Auth0 offers a generous **free tier**](https://auth0.com/pricing) to get started with modern authentication.

Now head over to [clients tab](https://manage.auth0.com/#/clients) and create a new one choosing 'Regular web Application' as the client type. Let's name it as something like 'Basic PHP WebApp'.

Now that we have our client created, we need to take note of three properties: `Domain`, `Client ID` and `Client Secret`. All of them can be found on the `Settings` tab of the client that we've just created.

The last configuration that we need to do, before updating our code, is to add `http://localhost:3000` as an `Allowed Callback URLs` on our Auth0 client.

### Build the App

Create a `composer.json` file in a new directory and add this to it like so:

```js

{
    "name": "basic php webapp",
    "description": "Basic sample for securing a WebApp with Auth0",
    "require": {
         "vlucas/phpdotenv": "2.3.0",
         "auth0/auth0-php": "~4.0"
    },
    "license": "MIT"
}

```
_composer.json_

All we need is the `phpdotenv` package for reading environment variables and the `auth0-php` package that makes it easy to use the Auth0 service.

Create a `public` folder inside the directory and add two files, `app.css` and `app.js` in it.

```css

body {
  font-family: "proxima-nova", sans-serif;
  text-align: center;
  font-size: 300%;
  font-weight: 100;
}
input[type=checkbox],
input[type=radio] {
  position: absolute;
  opacity: 0;
}
input[type=checkbox] + label,
input[type=radio] + label {
  display: inline-block;
}
input[type=checkbox] + label:before,
input[type=radio] + label:before {
  content: "";
  display: inline-block;
  vertical-align: -0.2em;
  width: 1em;
  height: 1em;
  border: 0.15em solid #0074d9;
  border-radius: 0.2em;
  margin-right: 0.3em;
  background-color: white;
}
input[type=radio] + label:before {
  border-radius: 50%;
}
input[type=radio]:checked + label:before,
input[type=checkbox]:checked + label:before {
  background-color: #0074d9;
  box-shadow: inset 0 0 0 0.15em white;
}
input[type=radio]:focus + label:before,
input[type=checkbox]:focus + label:before {
  outline: 0;
}
.btn {
  font-size: 140%;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 0;
  background-color: #16214D;
  color: white;
}
.btn:hover {
  background-color: #44C7F4;
}
.btn:focus {
  outline: none !important;
}
.btn.btn-lg {
  padding: 20px 30px;
}
.btn:disabled {
  background-color: #333;
  color: #666;
}
h1,
h2,
h3 {
  font-weight: 100;
}
#logo img {
  width: 300px;
  margin-bottom: 60px;
}
.home-description {
  font-weight: 100;
  margin: 100px 0;
}
h2 {
  margin-top: 30px;
  margin-bottom: 40px;
  font-size: 200%;
}
label {
  font-size: 100%;
  font-weight: 300;
}
.btn-next {
  margin-top: 30px;
}
.answer {
  width: 70%;
  margin: auto;
  text-align: left;
  padding-left: 10%;
  margin-bottom: 20px;
}
.login-page .login-box {
  padding: 5px 0;
}

```

_app.css_

```js

$(document).ready(function() {
    var webAuth = new auth0.WebAuth({
        domain: AUTH0_DOMAIN,
        clientID: AUTH0_CLIENT_ID
    });

    $('.btn-login').click(function(e) {
        e.preventDefault();
        webAuth.authorize({
            responseType: 'code',
            redirectUri: AUTH0_CALLBACK_URL
        });
    });
});

```

_app.js_

Go ahead and create a `.htaccess` file inside the directory like so:

```bash

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]

```

Create a `.env` file. This file will contain our Auth0 credentials.

```bash

AUTH0_DOMAIN='blahabababababa.auth0.com'
AUTH0_CLIENT_ID='xxxxxxxxx'
AUTH0_CLIENT_SECRET='xxxxxxxxx'
AUTH0_CALLBACK_URL='http://localhost:3000'

```

**Note:** Replace these values with the `client_id`, `client_secret` and `domain` from your Auth0 dashboard.

Add the value of `callback_url` to the **Allowed Callback URLs** in your *Settings* on the dashboard.

![Auth0 Dashboard showcasing Callback Url](https://cdn.auth0.com/blog/app/callbackurl.png)
_Auth0 dashboard: Allowed Callback Urls_

Also, do not forget to add the same value to the **Allowed Origins(CORS)** in your *Settings* on the dashboard.

![Auth0 Dashboard showcasing Allowed Origin Cors](https://cdn.auth0.com/blog/app/cors.png)
_Auth0 dashboard: Allowed Origin CORS_

We need a file to invoke the `dotenv` library and load the values that we have deposited in the `.env` file. Create a new file, *dotenv-loader.php* like so:

```php

<?php

  // Read .env
  try {
    $dotenv = new Dotenv\Dotenv(__DIR__);
    $dotenv->load();
  } catch(InvalidArgumentException $ex) {
    // Ignore if no dotenv
  }

```
_dotenv-loader.php_

Finally, let's create the `index.php` file where all our app logic will reside. Like I mentioned earlier, it's just a basic app so don't be worried about separation of concerns.

This is how the file should look like:

{% highlight html %}
<?php

// Require composer autoloader
require __DIR__ . '/vendor/autoload.php';

require __DIR__ . '/dotenv-loader.php';

use Auth0\SDK\API\Authentication;

$domain        = getenv('AUTH0_DOMAIN');
$client_id     = getenv('AUTH0_CLIENT_ID');
$client_secret = getenv('AUTH0_CLIENT_SECRET');
$redirect_uri  = getenv('AUTH0_CALLBACK_URL');

$auth0 = new Authentication($domain, $client_id);

$auth0Oauth = $auth0->get_oauth_client($client_secret, $redirect_uri, [
  'persist_id_token' => true,
  'persist_refresh_token' => true,
]);

$starWarsNames = ['Darth Vader', 'Ahsoka Tano', 'Kylo Ren', 'Obi-Wan Kenobi', 'R2-D2', 'Snoke'];

$userInfo = $auth0Oauth->getUser();

if (isset($_REQUEST['logout'])) {
    $auth0Oauth->logout();
    session_destroy();
    header("Location: /");
}

?>

        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">

        <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
        <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">

        <link href="public/app.css" rel="stylesheet">

              <?php if(!$userInfo): ?>

Heard you don't want to migrate to PHP 7? Dare us!

                SignIn

              <?php else: ?>

Star Wars Welcomes You to the Family!

                <img class="avatar" width="200" src="<?php echo $userInfo['picture'] ?>"/>

Welcome <?php echo $userInfo['nickname'] ?>

 Assigned Codename : <?php echo $starWarsNames[rand(0, 6)]; ?>

                Logout

              <?php endif ?>

{% endhighlight %}

Relax, let's analyze the code together.

```php

// Require composer autoloader
require __DIR__ . '/vendor/autoload.php';

require __DIR__ . '/dotenv-loader.php';

```

This is where we require the dotenv loader and composer autoloader. The autoloader makes it possible for us to import any class from the PHP packages installed in the app.

```php

use Auth0\SDK\API\Authentication;

$domain        = getenv('AUTH0_DOMAIN');
$client_id     = getenv('AUTH0_CLIENT_ID');
$client_secret = getenv('AUTH0_CLIENT_SECRET');
$redirect_uri  = getenv('AUTH0_CALLBACK_URL');

$auth0 = new Authentication($domain, $client_id);

$auth0Oauth = $auth0->get_oauth_client($client_secret, $redirect_uri, [
  'persist_id_token' => true,
  'persist_refresh_token' => true,
]);

$starWarsNames = ['Darth Vader', 'Ahsoka Tano', 'Kylo Ren', 'Obi-Wan Kenobi', 'R2-D2', 'Snoke'];

$userInfo = $auth0Oauth->getUser();

```

`Auth0\SDK\API\Authentication` is the Auth0 authentication class. It has the methods to retrieve a user's profile when logged in. `$domain`, `$client_id`, `$client_secret`, `$redirect_uri` are variables that will house the values gotten from the `.env` file with the aid of the `getenv` method.

Then, we moved on to instantiating the `Authentication` class.

The `$auth0->get_oauth_client()` method by default stores user information in the PHP session, and we also instructed it to save the `refresh_token` and `id_token`.

`$starWarsNames` array contains some characters from Star Wars. Later in the code, a user will be assigned a random code name from this array.

`$auth0Oauth->getUser()` retrieves the user information.

```php

if (isset($_REQUEST['logout'])) {
    $auth0Oauth->logout();
    session_destroy();
    header("Location: /");
}

```

This checks if the user submitted a request to log out, clears the session and redirects the user back to the homepage.

{% highlight html %}

{% endhighlight %}

We are making use of [Auth0's Centralized Login Page](https://auth0.com/docs/hosted-pages/login), and we also using jQuery to call the methods and handle button click event.

> [Auth0's Centralized Login Page](https://auth0.com/docs/hosted-pages/login) is the most secure way to easily authenticate users for your applications.

{% highlight html %}

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet">
{% endhighlight %}

Pulled in bootstrap and font-awesome for beautification.

{% highlight html %}

{% endhighlight %}

Here, we are feeding the Auth0 credentials to JavaScript variables.

{% highlight html %}

      <?php if(!$userInfo): ?>

Heard you don't want to migrate to PHP 7? Dare us!

        SignIn

      <?php else: ?>

Star Wars Welcomes You to the Family!

        <img class="avatar" width="200" src="<?php echo $userInfo['picture'] ?>"/>

Welcome <?php echo $userInfo['nickname'] ?>

 Assigned Codename : <?php echo $starWarsNames[rand(0, 6)]; ?>

        Logout

      <?php endif ?>

{% endhighlight %}

In the code above, if the `$userInfo` is not set, then it means the user has not logged in yet, so we display the signin button. If the user has signed in, then we grab the user's info and display it along with the `logout` button.

**Important Security Note:** If you have an API for your application, the [`id_token` should not be used to secure the API](https://auth0.com/blog/why-should-use-accesstokens-to-secure-an-api); instead use an `access_token` with the appropriate configuration. You can read about how to [implement API authentication with Auth0](https://auth0.com/docs/apis) with [implicit grant](https://auth0.com/docs/api-auth/tutorials/implicit-grant).

### Run The App

Go to your terminal and run `composer install` to install the dependencies. Next, run your PHP 5.x server. If your PHP server is accessible from the terminal, then you can run it via `php -S localhost:3000`.

Open your browser and test the app. The index page should look like this:

![Index](https://cdn.auth0.com/blog/app/header.png)
_Index Page_

Now, signup & signin.

![Auth0 centralized login screen](https://cdn.auth0.com/blog/resources/auth0-centralized-login.jpg)
_Sign In_

When you are logged in, you should be assigned a Star Wars codename like so:

![Logged In](https://cdn.auth0.com/blog/app/loggedin.png)
_Logged In_

Our app is now running successfully on a PHP 5.x server. You can grab the [source code from Github](https://github.com/auth0-blog/starwars-phpapp) to ensure that everything works as expected.

### Migrating our PHP5 App to PHP7

We are currently running a PHP 5.x app. Let's migrate it to PHP 7. The good thing is that most times you might not have to change anything in the codebase. Let's see if that holds true for this app.

Upgrade your server to at least PHP 7.0.0 and run this app again.

![PHP 7 Server running](https://cdn.auth0.com/blog/app/php7status.png)
_PHP 7 Server running_

![Running on PHP 7](https://cdn.auth0.com/blog/app/php7_running_app.gif)
_App running on PHP 7 without any errors_

Awesome, now our first app is running on PHP 7 successfully!

## Work with Second App

The second PHP app we will go through is an API. It is a simple Chuck Norris API. It has been built already with PHP 5 in mind.

Clone it from [Github](https://github.com/auth0-blog/basic-api) and run `composer install` to install all the dependencies. Then run the app on a PHP 5.x server.

Open up [Postman](https://www.getpostman.com) and test the API like so:

Run `http://localhost:3000/jokes/categories` like so:

![Categories API](https://cdn.auth0.com/blog/app/categories.png)
_API showing categories_

Run `http://localhost:3000/jokes/random` like so:

![Random Jokes](https://cdn.auth0.com/blog/app/randomjokes.png)
_API showing random jokes_

The app is working fine, no errors!

### Use PHP 7 features in Second App

Let's refactor this app and integrate some PHP 7 features.

This is the directory structure of our API app at the moment:

```bash

----basic-api
  |
  ----src
  |  |
  |  ----Main.php
  |
  ----vendor
  |
  ----.gitignore
  |
  ----.htaccess
  |
  ----composer.json
  |
  ----composer.lock
  |
  ----index.php
  |
  ----README.md

```

This is how our `Main.php` file looks like right now:

```php

<?php

namespace App;

use Exception;

class Main {

    public function getCategories() {
        return $this->getCategoryData();
    }

    private function getCategoryData() {
        return  [
            "explicit",
            "dev",
            "movie",
            "food",
            "celebrity",
            "science",
            "political",
            "sport",
            "religion",
            "animal",
            "music",
            "history",
            "travel",
            "career",
            "money",
            "fashion"
        ];
    }

    public function getRandomJokes($randomNumber) {

        if( !is_integer($randomNumber)) {
            throw new Exception("The random number should be an integer. Please try again.");
        }

        $jokes = [
          "Jon Skeet's code doesn't follow a coding convention. It is the coding convention.",
          "Jon Skeet can divide by Zero.",
          "Jon Skeet points to null, null quakes in fear.",
          "Jon Skeet is the traveling salesman. Only he knows the shortest route.",
          "When Jon pushes a value onto a stack, it stays pushed.",
          "Drivers think twice before they dare interrupt Jon's code.",
          "Jon Skeet does not sleep…. He waits.",
          "Jon Skeet can stop an infinite loop just by thinking about it.",
          "Jon Skeet uses Visual Studio to burn CDs.",
          "Jon Skeet has the key to Open Source. He just doesn't want to close it."
        ];

        return $jokes[$randomNumber];
    }
}

```

Let's start by adding PHP 7 return type declarations to the methods in this class like so:

```php

<?php

namespace App;

class Main {

    public function getCategories(): array {
        return $this->getCategoryData();
    }

    private function getCategoryData(): array {
        return  [
            "explicit",
            "dev",
            "movie",
            "food",
            "celebrity",
            "science",
            "political",
            "sport",
            "religion",
            "animal",
            "music",
            "history",
            "travel",
            "career",
            "money",
            "fashion"
        ];
    }

    public function getRandomJokes($randomNumber): string {

        if( !is_integer($randomNumber)) {
            throw new Exception("The random number should be an integer. Please try again.");
        }

        $jokes = [
          "Jon Skeet's code doesn't follow a coding convention. It is the coding convention.",
          "Jon Skeet can divide by Zero.",
          "Jon Skeet points to null, null quakes in fear.",
          "Jon Skeet is the traveling salesman. Only he knows the shortest route.",
          "When Jon pushes a value onto a stack, it stays pushed.",
          "Drivers think twice before they dare interrupt Jon's code.",
          "Jon Skeet does not sleep…. He waits.",
          "Jon Skeet can stop an infinite loop just by thinking about it.",
          "Jon Skeet uses Visual Studio to burn CDs.",
          "Jon Skeet has the key to Open Source. He just doesn't want to close it."
        ];

        return $jokes[$randomNumber];
    }
}

```

_PHP 7 Return Type Declarations added in Main.php_

Another PHP 7 feature we can add is *function parameter typehinting*. We have a method, `getRandomJokes($randomNumber)` that accepts a `$randomNumber` which is an integer.

Let's refactor that method, `getRandomJokes()`. We'll eliminate the `if` condition and just typehint the `$randomNumber` parameter like so:

```php

public function getRandomJokes(int $randomNumber): string {

        $jokes = [
          "Jon Skeet's code doesn't follow a coding convention. It is the coding convention.",
          "Jon Skeet can divide by Zero.",
          "Jon Skeet points to null, null quakes in fear.",
          "Jon Skeet is the traveling salesman. Only he knows the shortest route.",
          "When Jon pushes a value onto a stack, it stays pushed.",
          "Drivers think twice before they dare interrupt Jon's code.",
          "Jon Skeet does not sleep…. He waits.",
          "Jon Skeet can stop an infinite loop just by thinking about it.",
          "Jon Skeet uses Visual Studio to burn CDs.",
          "Jon Skeet has the key to Open Source. He just doesn't want to close it."
        ];

        return $jokes[$randomNumber];
}

```

Now if you try to pass in a value asides an integer like so:

```php

$router->get('/jokes/random', function() use ($app){
  echo json_encode($app->getRandomJokes("dsdsds"));
});

```
_index.php_

PHP 7 will throw a Type Error like so:

![Type Error](https://cdn.auth0.com/blog/app/typeerror.png)
_PHP 7 TypeError_

We have been able to add some PHP 7 features. The app also runs on a PHP 7 server and everything just works fine!

The source code of the PHP 7 version of the API can be found on the [`php7 branch` on GitHub](https://github.com/auth0-blog/basic-api/tree/php7).

## Performance

PHP 7 runs on the new Zend engine 3.0, thus making your apps see up to 2x faster performance and 50% better memory consumption than PHP 5.6. It also allows you to serve more concurrent users without adding any hardware.

[Rasmus Ledorf](https://twitter.com/rasmus), *Creator of PHP* and inventor of the SQL LIMIT clause did some benchmarking with a few popular PHP projects with the various versions of PHP from PHP 5.4 up until PHP 7.0 and also benchmarked against HHVM 3.6.1.

Let's take a good look at the benchmarks. The test box specs Rasmus used are:

* Gigabyte Z87X-UD3H i7-4771 4 cores @ 3.50GHz w/ 16G of Ram @ 1600MHz
* Hyperthreading enabled for a total of 8 virtual cores
* Toshiba THNSNHH256GBST SSD
* Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt9-2 (2015-04-13) x86_64 GNU/Linux
* MySQL 5.6.24
* Nginx-1.6.2 + php-fpm for all tests unless indicated otherwise
* Quiet local 100Mbps network
* Siege benchmark tool run from a separate machine

![ZenCart 1.5.4](https://cdn.auth0.com/blog/benchmark/zencart.png)
_ZenCart 1.5.4_

![Moodle 2.9-dev](https://cdn.auth0.com/blog/benchmark/moodle.png)
_Moodle 2.9-dev_

![Cachet](https://cdn.auth0.com/blog/benchmark/cachet.png)
_Cachet_

![Traq 3.5.2](https://cdn.auth0.com/blog/benchmark/traq.png)
_Traq 3.5.2_

![Geeklog 2.1.0](https://cdn.auth0.com/blog/benchmark/geeklog.png)
_Geeklog 2.1.0_

![Wardrobe CMS 1.2.0](https://cdn.auth0.com/blog/benchmark/wardrobecms.png)
_Wardrobe CMS 1.2.0_

![Opencart 2.0.2.0](https://cdn.auth0.com/blog/benchmark/opencart.png)
_Opencart 2.0.2.0_

![MediaWiki 1.24.1](https://cdn.auth0.com/blog/benchmark/mediawiki.png)
_MediaWiki 1.24.1_

![phpBB 3.1.3](https://cdn.auth0.com/blog/benchmark/phpBB.png)
_phpBB 3.1.3_

![Wordpress 4.1.1](https://cdn.auth0.com/blog/benchmark/wordpress.png)
_Wordpress 4.1.1_

![Drupal 8](https://cdn.auth0.com/blog/benchmark/drupal.png)
_Drupal 8_

From the results above, you can see that we can make double the amount of requests in less time in PHP 7 than PHP 5.

These specs can be found in the `Speeding Up The Web With PHP 7` talk he gave at Fluent Conf, 2015.

Check out the following benchmarks:

* [php7-benchmarks](https://github.com/martin-helmich/php7-benchmarks)
* [php7 final version vs hhvm benchmark](https://kinsta.com/blog/the-definitive-php-7-final-version-hhvm-benchmark)
* [hhvm vs php7 performance show down - Wordpress, Nginx](http://blog.wpoven.com/2016/04/14/hhvm-vs-php-7-performance-showdown-wordpress-nginx)

## Conclusion

We have successfully covered how to upgrade your development and server environments from PHP 5 to PHP 7, gone through the features PHP 7 offers and also migrated two apps from PHP 5 to PHP 7.

Woot! Woot! It's been quite a journey highlighting everything PHP 7 has to offer. PHP has grown tremendously over the years from a toy language to a full-blown fast and enterprise language.

The [PHP Manual](http://php.net/manual/en/index.php) and [RFC](https://wiki.php.net/RFC) documents remain the most complete go-to reference for any of the new PHP 7 features. You can always leverage them for more information.