Avoid complex arrays in PHP

Now that PHP 7+ sorted out a whole bunch of problems with type-hinting of parameters, return values, variables and properties, we turn our attention to somewhat deeper issues.

Array is a native citizen in PHP.  Arrays are very convenient and are widely used.  However, if you stop and think about the times where you had to figure out somebody else’s code, I’m pretty sure complex arrays will come to mind at some point.

I’ve recently came across two completely independent blog posts which talk exactly about this particular area of problems:

Both are explaining the issues very well and make valid points.  As far as solutions and better ways go, apart from the approaches mentioned in these blog posts, I also remembered a recent blog post from which I linked to the data transfer object library, that solves exactly that.

RoadRunner – high-performance PHP application server, load-balancer and process manager

RoadRunner is a high-performance PHP application server, load-balancer and process manager, written in Goland.  It sounds like an excellent replacement for the built-in PHP server, and even more than that – it’s production-ready.  And it works on Windows too.

RoadRunner is an open source (MIT licensed) high-performance PHP application server, load balancer and process manager. It supports running as a service with the ability to extend its functionality on a per-project basis.

RoadRunner includes PSR-7/PSR-17 compatible HTTP and HTTP/2 server and can be used to replace classic Nginx+FPM setup with much greater performance and flexibility.

VivaGraphJS – Graph drawing library for JavaScript

VivaGraphJS is a graph drawing library for JavaScript.  It’s a lot prettier than the results of GraphViz dot.  Or at least, it’s easier to get fancy things out of it.  It also ties a lot easier into the web development in general and your DOM document in particular.

CMS Scanner: Scan WordPress, Drupal, Joomla, vBulletin websites for Security issues

CMS Scanner is a security tool from Open Security crew that you can host locally and use for security scans of WordPress, Drupal, Joomla, and vBulletin websites.  I think that having an automated tool like that is way better and more productive than a thousand blog posts on how to secure your installation of a particular software.

PHP 7.3 Performance Benchmarks Are Looking Good Days Ahead Of Its Release

PHP 7.3 is scheduled to be released on December 6th, 2018.  As always, it’ll bring a few changes and new features (read more about it here or here).  But it’ll also bring a significant performance improvement.  Here are the results of a few benchmarks.  Long story short:

PHP 7.3 is just shy of 10% faster than PHP 7.2 in the popular PHPBench. PHP 7.3 is 31% faster than PHP 7.0 or nearly 3x the speed of PHP5.

Bring it on, I say!