PHP is dead. Long live PHP.
PHP, the language that has supposedly been dead for years, is still alive. It's like a zombie that just won't stop.
For years we've been hearing the same thing over and over again: "PHP is outdated and slow. You should rather use this new and modern language that will revolutionise the web." For example Javascript, or even better: Rust. Haha. Because that's twelve times faster.
Breaking News:
PHP is still alive and very much so!
Let's take a look at the reality. Most websites on the internet use PHP and MySQL. How do I arrive at this statement? Around 43% of all websites use Wordpress. This is much more worthy of criticism than the question of whether PHP is cool or not - but that's not the point today. One could even say that this is an argument for PHP: PHP has been optimised over the years to such an extent that even a bad system like Wordpress can be run sufficiently fast.
Why is PHP used so often?
Certainly not just because you can't get rid of Wordpress but because it works! It may not be the coolest kid on the block, but it does its job and it does it very well. PHP has evolved tremendously over the years and has become a robust language. Anyone who has mastered object-oriented programming is able to write well-scaling web apps.
PHP frameworks like Laravel
And what about the frameworks? Let's talk about Laravel. It is not only comprehensive, but also mature. After installing Laravel and a starter kit, you get a web app that already contains all the rudimentary features that just about every project needs:
Login and registration
Password change and recovery
Two-factor authentication
Team management
as well as numerous features that are relevant for further development.
Which Javascript or Rust framework can offer this? None. In the Javascript world, the above points could certainly be achieved by merging numerous packages. But the time required is disproportionate to the speed and quality with which we can bootstrap a project with Laravel (PHP).
As a rule, a new Javascript framework is praised because it is so much faster. So what is faster? The hot reloading? Wow. And what does that do for me? While I have to reinvent the wheel again to implement the basic functions mentioned above, at least the waiting time is shortened. Thank you.
Shots fired.
With Laravel (and PHP), we skip that and go straight to solving our customers' problems. This is where the real added value comes from. Not from fast hot reloading or 2% more requests per second.
Microservices are not a solution either
The hype around new technologies is often tempting. Microservices and containerisation and serverless architectures are still hot topics. But let's not be blinded by this hype. Yes, for some large companies and complex systems, microservices can make sense. But for small teams and projects, a monolithic approach is much better.
Microservices may offer theoretical advantages, but in practice they also bring with them a lot of overhead (= costs). The development and maintenance of microservices require more effort and resources. It takes specialised staff (in times of skills shortages) and a solid infrastructure to run them effectively. For small teams, this can be a huge burden that has a negative impact on progress and productivity.
So if you're not Netflix, you might as well do without microservices. And even Amazon is going back to a monolithic architecture and saving 90% of its costs.
Laravel and high availability
Until 2021, Lumen existed as a microframework to provide enough speed for particularly performance-hungry use cases. This is no longer necessary today. The development of Lumen has been discontinued. With PHP-OPCache, solutions like Octance or Vapor as scaled hosting via AWS, almost any PHP workload can be handled.
Doubts?
But who am I to say all that? The founder of an agency specialising in Laravel and PHP? Is that credible? Of course I have that opinion.
You know who else has this opinion? The Fullstack developer Adam Elmore. In his very likeable and entertaining Youtube video, he tries Laravel for the first time and is visibly thrilled. 🎉
Laravel and PHP is used by enterprise companies
OpenAI, the leader in artificial intelligence right now, has chosen Twill to manage their website. Twill is a CMS developed specifically for Laravel. This choice underlines the power of Laravel and PHP as the basis for mission-critical systems.
Shopify, one of the largest and most popular e-commerce platforms uses Laravel as a template for building Shopify apps.
Long live PHP!