Vim setup for PHP development

Robert Basic shares his “current Vim setup for PHP development“.  He shows how setup the Gutentags plugin, jump to definitions with CtrlP plugin, display of the current file and method in the status line, add support for PHP namespaces, improve linting with Asynchronous Lint Engine, and add support for PHPStan.

Via PHPDeveloper.

Modern Software Over-Engineering Mistakes

Modern Software Over-Engineering Mistakes” is a nice collection of examples, results and reviews of over-engineering mistakes of the modern day.

Continue reading Modern Software Over-Engineering Mistakes

GitHub to MySQL

GitHub to MySQL is a handy little app in PHP that pulls labels, milestones and issues from GitHub into your local MySQL database.  This is useful for analysis and backup purposes.

There are a few example queries provided that show issues vs. pull requests, average number of days to merge a pull request over the past weeks, average number of pull requests open every day, and total number of issues.

I think this tool can be easily extended to pull other information from GitHub, such as release notes, projects, web hooks.  Also, if you are using multiple version control services, such as BitBucket and GitLab, extending this tool can help with merging data from multiple sources and cross-referencing it with the company internal tools (bug trackers, support ticketing systems, CRM, etc).

This is not something I’ll be doing now, but I’m sure the future is not too far away.

PHP overwrite of built-in constants (true is false)

Here is a scary thing I picked up on Reddit PHP:

<?php
use const true as false;
if (false) {
    echo "uh-oh";
}

Until PHP 5.6 this was throwing a parse error, but from then on – it’s just fine.  Scary, right?

The comments on the Reddit thread are quite helpful.  Technically, this is not overwriting (shadowing?) since the original constant is still available:

<?php
use const true as false;
if (\false) {
    echo "uh-oh";
}

If you are a fan of nightmares, there is also this link, which will shake your religious beliefs …