Why I Continue to Write PHP
PHP has improved significantly
The best place to start my defence is by dismissing a common fallacy — PHP is not potent enough. PHP has new features which make it a robust solution for server-side programming-related problems. Chief among the new additions are the enhancements to the Zend and HHVM engines which have drastically increased language performance. Also, the additions to the versions of the language 7.0 and upwards have marked overall improvement in coding experience.
Among the additions are anonymous classes, modern cryptography with the inclusion of libsodium and Argon2 packages, return type hint capability, and new operators — spaceship as well as null-coalesce operators. The language also has a Read Evaluate Print Loop (REPL) contrary to popular belief and has had one since the 5.1.0 release.
PHP’s revived potency is such that one can write applications that run beyond the standard web environment. Command Line Interfaces (CLIs) and daemons can be idiomatic PHP implementations. Take Composer for example, PHP’s defacto package manager: it runs a PHP Archive (.phar) file which helps install and manage PHP packages.
If affirmation from Lord Rasmus, creator of the best language in the world, is what you need, check out this video from the We Are Developers conference from 2017. In the video, Mr Lerdorf (Dumbledore in disguise), discusses the evolution of the language.
Functional Programming is Possible in PHP
The current zeitgeist of programming, the functional programming paradigm, can be used in PHP too. Though not organically built to support functional programming, PHP’s current specification suffices to this end. From composing functions to using Applicatives and Monads, PHP has a variety of tools to help ease the process of reducing the cognitive burden. Check out my series on Functional Programming in PHP — rumor has it, I’m writing a book on the same topic. Oh, check out my library too.
Experimenting with PHP is fun
Closely related to the functional programming experience in PHP is the experimentation that comes with the language’s many downloadable utilities. Parallelizing tasks with the php-amqp library and RabbitMQ message broker is particularly interesting. Doing this enters the loosely coupled communications conversation space — sending data to many services and monitoring data feeds are immanent in this discourse.
php-amqplib/php-amqplib - Packagist
This library is a pure PHP implementation of the AMQP 0-9-1 protocol. It's been tested against RabbitMQ. Requirements…
Additionally, pushing the boundaries of PHP by attempting asynchronous operations using the react-php library is quite cathartic. Most of the disdain for PHP stems from its default synchronous nature — going against the grain can be mentally reassuring.
react/stream - Packagist
Event-driven readable and writable streams for non-blocking I/O in ReactPHP. In order to make the EventLoop easier to…
Combining functional programming in PHP with the modularity of a React-Redux-workflow can be quite exciting. Serving data to a JS-driven front-end service by using well crafted private API’s, I find, separates concerns nicely. Furthermore, frameworks like Symfony and Laravel make bootstrapping a PHP application a breeze. The latter has bindings for vue-js and a webpack configuration abstraction.
In conclusion, a lot remains on the horizon for PHP. Like most things, PHP needs to evolve and might continue to get better with the introduction of a Just-In-Time compiler. Ever since I first wrote PHP code in 2014, my life has not been the same. The sentimental value PHP has in my life is expressed in how passionately I endorse the language. I do not intend to spur argument and strife as I acknowledge that everyone has a preference — mine just happens to be PHP.