Learning PHP makes sense if...you want to program in PHP. And what are the future prospects for this language? PHP has been "killed" many times already, but somehow stubbornly doesn't want to go away. And this is not going to change in the near future. So let's take a look at the state of PHP in its 27th year of life.
PHP's popularity is undeniable
Usually, Wordpress is mentioned as the first example of PHP usage. This popular CMS according to various statistics is the foundation of up to 40% of sites across the internet.
We could discuss quite a long time about the quality of Wordpress code itself (let's just say that it's far from perfect). It doesn't change the fact that no other website building system can compete with such popularity.
In the e-commerce industry, we have a very popular system called Magento. It too can boast of good results:
- over 250000 actively operating stores
- 12% of all stores on the Internet
Magento is a first class competitor in its industry and another example of the practical application of PHP.
Let's have a look at the statistics from Stack Overflow. They apply to 2020 but probably not much will change in 2021. You can clearly see that 26% of those surveyed use PHP to a greater or lesser extent. And the language itself in terms of popularity is on the 8th place. That's not bad, is it?
A long way to version number 8
PHP was intended by the author to be a simple language for generating dynamic web page views. And I guess the author didn't realize at the beginning how quickly PHP would be adapted to create things far beyond the original intent.
Years passed, PHP's popularity continued to grow, but the language itself didn't change much. And that initial simplicity quickly became a burden for programmers. The more complex the application, the harder it was to write clear, error-free code in PHP. This was simply due to the very nature of the language.
That's why finally the time for changes has come. First in the form of version number 7 and now additionally in the form of PHP 8. The newest versions of the language are very different from its initial assumptions. And finally, although quite late, they bring the PHP language into the 21st century.
What does PHP offer in 2021?
As a PHP programmer nowadays, you have many new mechanisms at your disposal that were unavailable in older versions of the language.
- Significant performance enhancements that came in PHP version 7.
- New built-in functions.
- Anonymous classes, array constants, named arguments and a whole bunch of smaller or bigger improvements.
But programming is not just about the mechanisms of the language itself. Any experienced developer will tell you that the ecosystem of tools, packages, code editors etc. is also important. Equally important is the so-called workflow or the way we integrate all these elements when developing a PHP application.
Recent years look really good in this respect. PHP offers a whole ecosystem of tools for writing tests, for automating tasks, and more. And this ecosystem is growing all the time. Take a look at the statistics of the popular PHP package manager for example: https://packagist.org/statistics.
PHP takes full advantage of the achievements of the modern programming world. We have the ability to deploy applications using Docker containers. We have the ability to write clear, readable code that is easy to test. We can use a wide set of libraries, frameworks and tools. There has never been a better time to learn PHP.
The PHP ecosystem also includes frameworks for writing web applications quickly. One of them is Laravel. It is a very popular framework for writing fast, stable and secure PHP applications. For large enterprise projects, Symfony is a popular choice.
Whether it's worth it or not
PHP still has very broad applications. Its future looks pretty good too. Especially if we take into account the real improvements that appeared in the latest versions of the language.
The language has its criticizers, and some would even like it to disappear altogether. While it made sense in the older versions of the language, nowadays PHP evolved and it has been vastly improved. Contrary to what some people think, you can write modern, efficient and stable web applications with it. Of course it's not a perfect language. It has its quirks and shortcomings. This does not change the fact that with the right approach it can be a good choice both for writing a simple project and for creating a large typically commercial application.