DEV Community

gitter4coding
gitter4coding

Posted on

Is PHP Really Dead? Unveiling the Truth Through PHP’s Evolution

In 1994, I was born in a small town in the United States. That same year, Canadian Rasmus Lerdorf created PHP. At the time, PHP was just a CGI script written in Perl. Perhaps by fate, PHP became my means of livelihood in the latter half of my life. Lerdorf’s original purpose for writing these scripts was simply to track visitors to his website. Thus, a simple beginning gave birth to “the best language in the world, PHP.” Great undertakings often have humble beginnings. These CGI scripts written in Perl can be seen as the prototype of PHP, even considered the first version, “PHP 1.0.”

This article is brought to you by ServBay — the next-generation web development environment that provides a fast, dependency-free, and non-intrusive installation solution for PHP/Node.js development environments. In just 3 minutes, you can have a complete development environment with a web server, database, email, DNS, and common tools, without needing Docker or source code compilation. Compatible with macOS 12 and above, supporting arm64 and x86_64 architectures, ServBay offers a high-performance and resource-saving development platform. Try ServBay and experience PHP 8.4!

Reportedly, the following code is from PHP’s first version. Does it look familiar to anyone?

html

<!--include /text/header.html-->
<!--getenv HTTP_USER_AGENT-->
<!--ifsubstr $exec_result Mozilla-->
  Hey, you are using Netscape!<p>
<!--endif-->
<!--sql database select * from table where user='$username'-->
<!--ifless $numentries 1-->
  Sorry, that record does not exist<p>
<!--endif exit-->
  Welcome <!--$user-->!<p>
  You have <!--$index:0--> credits left in your account.<p>
<!--include /text/footer.html-->
Enter fullscreen mode Exit fullscreen mode

That same year, Netscape released version 0.9 of the Navigator browser, the first mature web browser in history. Its release caused a sensation in the industry, providing fertile ground for the rapid development of PHP.

Image description

The following year, Rasmus Lerdorf released PHP 2.0. This version not only accessed databases but also embedded HTML to dynamically process data. These new features attracted a group of PHP enthusiasts, including Zeev Suraski and Andi Gutmans, who later joined the PHP core development team. The renowned “Zend VM engine” was led by these two developers.

By the end of 1998, instant messaging in the United States was on the rise, epitomized by AIM (AOL Instant Messenger). Around this time, the official version of PHP 3.0 was released. Its most compelling feature was its extensible modules, attracting numerous amateur developers to submit new extensions, laying a solid foundation for PHP’s ecosystem. The later emergence of the Swoole asynchronous communication extension also benefited from this.

Two years later, in the year 2000, right after the dot-com bubble burst, PHP 4.0 was released. This version introduced the Zend VM virtual machine engine written in C, significantly improving program execution performance. Additionally, it introduced support for classes and objects, marking the initial form of object-oriented features.

During the period of the “9/11” attacks in the United States in 2001, the open-source content management system WordPress v1.0, developed using PHP, was officially released. It was well-received by developers, significantly lowering the threshold for building blog websites. According to the latest statistics, WordPress’s market share has reached an astonishing 46%, making it the world’s most popular CMS. This means that about half of the websites on the internet are created using WordPress. It’s easy to imagine how WordPress’s popularity spurred the widespread adoption of PHP. I remember once rewriting WordPress source code, feeling overwhelmed by the procedural code, accustomed as I was to object-oriented programming. I wonder if other PHP developers have had similar experiences?

Image description

In 2004, the new era of PHP 5.0 was officially released, marking a significant milestone. Over the years, PHP iterated within the v5 version, making it the longest-lasting major version in PHP’s history. This version fully introduced object-oriented features and upgraded the Zend VM virtual engine to the second generation, significantly improving performance.

In 2007, three years after the release of PHP 5, the American PHP framework Laravel was born. Laravel’s release benefited many PHP developers. My first project was developed using Laravel, and I believe many PHP developers, like me, have benefited from this framework. However, the framework’s popularity further lowered the threshold for PHP development projects, attracting many people from non-professional backgrounds to switch to PHP development, leading to a mixed level of technical expertise among PHP developers today.

Image description

For a long time, PHP’s application scenarios were mainly concentrated on CMS content website construction, resulting in a lack of achievements in the field of asynchronous communication. It wasn’t until 2012 that Swoole released its first version. Although Swoole wasn’t perfect at first, it filled the gap in asynchronous network communication for PHP. This allowed PHP to shine in real-time communication, IoT communication, game development, and other fields, enhancing PHP’s development. That same year, Go language released its first version, v1.0, marking its maturity. Go is renowned for its high performance, whereas PHP has obvious shortcomings in this area, sowing the seeds for PHP developers to transition to Go language years later.

Image description

After more than a decade of iteration on the v5 version, PHP finally released PHP 7 at the end of 2015, marking a qualitative leap. Just as the reform and opening up significantly impacted China’s economy, PHP 7 had a similarly significant impact on PHP’s development history. Notably, Facebook engineer Sarah Goldman was one of the core initiators of PHP 7. PHP 7’s debut significantly improved Facebook’s system performance. Facebook’s early architecture used the LAMP stack, with PHP as the backend language. Many other platforms, like eBay and Wikipedia, also initially used PHP for development, proving PHP’s popularity at the time.

Image description

While we were still dealing with the COVID-19 pandemic and undergoing daily nucleic acid tests, PHP 8 was quietly released at the end of 2020. As a major update, its biggest highlight was the introduction of JIT (Just-In-Time) compilation technology. This technology allows PHP code to be compiled into machine code during execution, rather than being interpreted each time it runs. JIT compilation improves code execution efficiency, making PHP run faster with significant performance improvements. In short, PHP 8 injected strong momentum into the PHP ecosystem.

Today, although the pandemic has receded, its impact on the global economy persists, coupled with local unrest in some countries, leading to a continuous economic downturn. In this context, the internet industry is also facing challenges, with frequent layoffs in domestic internet companies, indirectly intensifying competition among programmers. The economy is like a cake; when it’s shrinking, there’s less to share. Programmers can’t expand outward, so they compete internally. Moreover, PHP has always been on the edge of the disdain chain, with developers of Java, C/C++, Go, and other languages considering their technologies superior. As a result, PHP developers are being squeezed out and forced to exit. I believe this is the real reason behind the perception that PHP is in decline.

Imagine if we could go back to the pre-pandemic era, with a booming global economy, a thriving internet industry, and flourishing small and medium-sized enterprises. In such a scenario, PHP would still dominate the programming language rankings and not fall out of the top ten. It is well-known that many renowned companies, both domestically and internationally, started with PHP, benefiting PHP-related practitioners immensely. Looking back, PHP’s contributions to the internet industry are enough to justify its nickname, “PHP is the best language in the world.”

Image description

I once saw a post on Reddit where a user expressed gratitude to PHP for the benefits it brought him. As a frontend developer, he was able to use PHP for backend development, taking on many outsourcing projects and earning substantial returns. However, someone retorted, saying that a lowly worker thanking a wrench is laughable. But I would argue that without the wrench, you might not even have the opportunity to screw bolts. Throughout PHP’s development, it has gradually met developers’ needs. Some languages come from prestigious backgrounds (e.g., Go language, created by the father of C language at Google), while others come from humble origins, leading to different growth paths and outcomes.

Image description

The era created Bill Gates, just as it did PHP. PHP 9 is still in development, and it is rumored to introduce native asynchronous programming with async/await, which will be a cutting-edge and efficient programming model for PHP. Finally, as the global economy gradually recovers and the internet industry continues to innovate, PHP will also rejuvenate. By maintaining its ease of use and flexibility while enhancing its performance, PHP is sure to firmly stand atop the web development world.

With many hands making light work, PHP developers should unite, weather the storm, and strive to build the PHP ecosystem. Let the voices claiming “PHP is dead” disappear, and bring PHP back to its peak.

Top comments (4)

Collapse
 
shawnlindstrom profile image
Shawn Lindstrom • Edited

PHP was never Perl although its syntax was influenced by Perl (and other langauges. It was initially a set of CGI binaries written in C. You can learn this from the PHP manual's history page.

Laravel's first release was June 2011--not 2007. Maybe you were thinking CodeIgniter? CI was February 2006. I don't know what you were using in 2007 to create your first project, but it wasn't Laravel. Also, I'd argue that Laravel had nothing to do with low quality PHP code. PHP was always accessible to non devs because of being available everywhere on cheap shared hosts. There were alternatives like FrontPage, ColdFusion, Classic ASP, and Perl, but outside of Perl it was hard or expensive to host. Perl never had a chance because it wasn't beginner friendly. So, PHP it was. WP came and the rest is history.

We got crappy PHP code because people without a programming background could jump in and use it easily and there were tons of scripts and tutuorials on using it. Many of these scripts and tutorials were procedural and rife with security issues. If you are reading this in the modern era of frameworks and OOP, you might not know or have forgotten how easy it is to implement a contact form with a single, procedural PHP file. That was a blessing and a curse for PHP.

I appreciate the effort it took to write this, but if I may offer some constructive criticism, a better take may have been to spin this as your journey through PHP's evolution and why now, more than ever, it's a great time to be using or adopting PHP. From my POV, PHP is THRIVING and ready to have another breakout moment like we saw with PHP 7 and Laravel.

Collapse
 
gitter4coding profile image
gitter4coding

Yes, I also believe that PHP is still thriving

Collapse
 
hakimio profile image
Tomas Rimkus • Edited

While I do agree that PHP 8 is a big step forward and the language is evolving at a pretty fast pace in general (both in terms of features and performance), but the fact is that its popularity is clearly going down.
Just check StackOverflow and Github language statistics:
Github
StackOverflow

Collapse
 
nicolus profile image
Nicolus

Let the voices claiming “PHP is dead” disappear, and bring PHP back to its peak.

Amen, but titling articles "Is PHP really dead ?" is counter productive in my opinion because it still implies that it kind of is.

Imagine that you work at a company where there's an elder programmer called Michael who's doing really good work but is not being acknowledged by the younger devs because of the generation gap... Do you think it would really help his situation to ask "Is Michael really an old fart ?", even if you then try and explain that he's not ?

I think the best way to collectively get past PHP's reputation as a "dead" language is to keep building things with it and share our success stories.