Alright - I admit that the title is intentionally dramatic. A more mundane title might be “PHP Isn’t the Wrong Choice in 2022 and Beyond”.
As an organizer for a conference focused on the PHP ecosystem, I’m used to the stigma many people associate with the language. This can make it difficult to attract speakers to our conference whose background isn’t in PHP: because of outdated information, they may view PHP as irrelevant or even actively harmful for web development.
Longhorn PHP recognizes that PHP developers can learn a lot from programmers in other disciplines. This post is an attempt to sell the idea of a PHP conference to you, a PHP skeptic and potential speaker. I’ll do that by explaining why people still choose PHP in 2022 - and why you might want to consider it yourself.
Most people know that PHP is popular, and that’s often counted against it (a low barrier to entry can lead to a lot of “beginner” code). But underneath that popularity lies a strong community that’s dedicated to seeing the language thrive.
There were recent concerns within the team that builds PHP about its sustainability. Although many people are involved in the decisions about future PHP updates, very few people had the knowledge and financial support to contribute to PHP core. Last year, in response to these concerns, the PHP Foundation was created to fund continuing development. Since its launch, the foundation has raised over half a million dollars to fund continued development of PHP. This support comes from individuals, open source communities, and businesses both small and large. Longhorn PHP has contributed as well!
The PHP community also loves sharing its knowledge. PHP Architect, published monthly, contains the latest news on PHP happenings. There are sites like Laracasts and Symfonycasts, as well as countless folks sharing their tips through Twitter, YouTube, newsletters, and more.
Many people remember PHP as a purely dynamic scripting language. Every recent PHP release has brought new abilities to PHP's type system, and today you can write a PHP application that is fully typed - and more type features will continue to arrive in future versions. One of the only missing pieces - generics - can still be done using tools like PHPStan and Psalm.
Cutting Edge and High Performance
PHP is often associated with an old version of the web, when an application back-end simply lived on a single server and responded to standard HTTP requests. These days, you can do a lot more with PHP. You can run a WebSockets server. You can build a serverless app in many different ways, whether through an open source, framwork agnostic tool like Bref, or via a batteries-included, framework specific SaaS like Laravel Vapor.
There are also multiple ways to run PHP in an event-driven, asynchronous manner to provide huge performance gains. In addition to userland libraries like React PHP, there are extensions like Swoole and Open Swoole that completely change the way PHP runs under the hood and add new aynchronous features for PHP developers. Roadrunner is a replacement server for PHP written in Go that can boost performance by only bootstrapping your application a single time.
PHP is also simply much faster out of the box than it used to be. Even without all of the tools mentioned above, PHP is more than capable of serving the vast majority of applications with high performance. For added performance that is still built-in, concurrency is now more strongly supported in PHP core through Fibers, and opcache continues to improve.
Mature, Feature-Rich Frameworks
PHP frameworks range from minimalist, with libraries like Slim, to having all of the bells and whistles you need in Laravel or Symfony. The most popular PHP frameworks have been around a long time, and are very mature. The bigger frameworks make it incredibly simple to incorporate features like caching and queueing into your application.
On top of these traditional frameworks there are now additional tools to help you rapidly build an application that behaves like a Single Page App but is written like a traditional app. Inertia is framework agnostic, while Livewire is a Laravel-specific option.
Okay, I probably haven’t convinced you to switch from your language of choice to PHP. But I hope that I've at least made you curious about PHP - and more interested in speaking at a PHP-focused conference. In addition to PHP-focused talks, we are interested in topics like accessibility, devops, frontend, programming patterns, and even introductions to new languages.