Is PHP still popular or getting old? Has it become a classy programming language?

January 30, 2020 Dan Gurgui 0 Comments

I started working with PHP many years ago. I was 15 years old, and I didn’t have any formal education or knowledge about programming or engineering. I was just curious about it. Initially, I used it to send emails with the help of mail() function, and then I started to work with forms and slowly learned control structures. By the time I went to university, I was familiar with basic programming and a few OOP features. By the time I finished university, I was able to work with frameworks such as CakePHP, I knew about ORM, dependency injection, and design patterns. Over the years, I worked with Symfony, starting from 1.2 to 4, but I also worked with other languages such as Ruby, JAVA, and GO. After working with GO for the past six months, I want to evaluate PHP — is it still popular or getting old? Is it maturing and extending, or is it ignored?

PHP is the most popular language for web applications, and after 25 years, it’s still powering many websites worldwide. Popularity and maturity for a programming language are challenging to define, and to keep it simple, this post will focus just a little on business trends, features, and emerging technologies.

The new features added to a programming language reflect how it’s used and what it’s aspirations are. Looking at changelogs provides valuable information about the community’s focus. If the community is busy with solving bugs and issues, then you’d probably want to think twice, both as a developer and manager. Everybody wants to use a programming language that continually adds new features, boosts performance, and focuses on saving time and energy for developers.

Best Coding Languages to Learn in 2019 | Data Driven Investor

During my years as an undergrad, I skipped many night-outs to pick up Java hoping it would one day help me get ahead in…

www.datadriveninvestor.com

Before releasing version 7, it felt that PHP was struggling with adding OOP features and improving performance. The language was plagued by issues related to using multiple libraries and slow unit tests. The new version felt like a breath of fresh air, the new Zend Engine boosted performance not only for websites but also for unit tests, speeding development time too. At the same time, the introduction of scalar types and return types paved the way for PHP to become friendly towards enterprise applications, such as financial systems, where type juggling is unacceptable.

Besides these improvements, PHP7 managed to keep up with the trends by adding new features or polishing existing ones. Keeping up with trends is essential for developers. Techniques and patterns used in other languages are successful because they increase productivity, save mental energy, and allow meaningful communication. It happens very often that programming languages start copying each other. PHP managed to keep up with the trends by adding better support for closures (very popular at that time in javascript), anonymous classes (Java), and a sexy null coalescing operator (C#).

Taking a look at the recent versions, from 7.0 to 7.4, PHP is totally focused on new features and making developers’ life more comfortable. It started to remove old syntax by adding symmetric array destructuring — no need to use list() function anymore. The focus on OOP has been extended with the addition of parameter type widening, object type hinting, typed properties, and type variance.

We can observe PHP’s maturity by also looking into the future. PHP8 is expected to deliver a JIT (just-in-time) compiler. JIT is the only way that PHP can get a boost of performance from now on, as many optimization strategies have been exhausted. But JIT will also allow the PHP language to be compiled and used outside WEB applications and thus paving the way for more enterprise applications.

Business trends reveal how a programming language is valued on the market. The popularity and maturity are defined by the supply and demand of developers, active positions and open applications, the number of open-source projects, and community support. I have included 4 data sets below, trends on StackOverflow, activity on Github, new positions opened in the UK, and average salaries in the UK. Looking at one single metric doesn’t reveal much, but combining all of it and comparing it with other programming languages should give us a good picture. I included data from the UK (excluding London) because it’s one of the few data sets that I found reliable and consistent.

StackOverflow has a section on its website called “Trends”, which presents how tags have been used over the years. Multiple programming languages can be compared to the interface. Growing usage of a tag means that people need information for that programming language and are adding questions for it. Compared to Java and Python, PHP had a significant decline in the last four years, although it seems to have stabilized in recent months. It can mean that fewer people are adding questions for the language, maybe because there is proper documentation already in place or fewer people are trying to learn.

Github provides metrics related to its platform at octoverse.github.com. The popularity of programming languages is the most crucial metric there. It measures what programming language is the most popular by repository contributors. PHP has remained constant throughout the years, which means that the community is stable and consistent in providing support and using PHP. Combining this metric with the downtrend on StackOverflow, we can see that not only is the community stable, but also effective and productive in providing useful documentation and solving bugs and issues. A stable open-source community is a clear sign of PHP being a mature programming language in this area.

ITJobsWatch gives insights into the IT market in the UK. While their data is not very accurate and limited in range, it does provide statistical relevance, and it was the best data that I could find. An increased number of new jobs added can mean different things. It can say that the programming language is unpopular, and engineers are switching technology or that the programming language is trendy, and companies are expanding projects that require those skills. It can also mean that developers enjoy working with that programming language and are not interested in switching technologies. When it comes to the new jobs added, PHP has remained constant in the past years, not gaining or losing positions.

To gain a real picture of it, we should also take a look at the salary range. PHP has always been the “cheapest” programming language because it’s effortless to use. Many developers start their careers with PHP, and that’s why the salaries are the lowest. But that seems to be changing, with wages slowly increasing over the years. Combining this metric with the fact that not many new jobs have been added, it can mean that fewer people are starting their careers with PHP.

Putting all the data together, the job market has remained constant in terms of jobs added. At the same time, salaries have been increasing slightly due to fewer engineers starting their careers with PHP. These two, combined with a stable community and reduced number of issues on StackOverflow, it can only mean one thing: PHP is maturing.

Before making an opinion, it’s essential to look at how new technologies are being integrated with PHP. One particular technology that has been making waves recently is GraphQL. It’s a new way of exposing backend functionalities, and it blends well with another accessible technology — React. A candidate for comparison is GO, because both languages are used for web implementations and have similar size of the community. I decided to compare the top libraries for GraphQL in terms fo contributors and forks. There aren’t many differences between the two of them, and it’s safe to say that PHP is advancing at the same rate as other programming languages when it comes to GraphQL support.

Other new technologies that have good support in PHP are WebSockets and concurrency (with Swoole becoming popular lately), as well as serverless (AWS added PHP to lambdas in 2019).

To put it all together, the focus on new features that paves the way for enterprise applications, combined with a good supply of engineers, constant job postings, and ability to integrate new technologies, make PHP a matured maturing programming language. It’s definitely not as mature as JAVA or popular as Python, and it will take a long way until PHP starts challenging other programming languages, but the opportunities are there.

leave a comment