Add syntactic sugar by preprocessing PHP

In an awesome article at Sitepoint Christopher Pitt explains how he used the yay macro library to build up plugin framework to add new language features to PHP. Chris made plugins that allows this syntax in PHP. // short closure syntax $items = [“one”, “two”, “three”]; $ignore = “two”; array_filter($items, ($item) => { return $item […]

Continue reading →

Configuration-driven PHP security advice considered harmful

Scott Arciszewski debunks the commonly given advice on securing your PHP installation by setting some php.ini values. There have been countless examples posted in various places (Reddit, Hacker News, Twitter, Facebook, Slashdot, and even LinkedIn group discussions), and while a handful occasionally contain one or two tips that might be beneficial towards securing your PHP […]

Continue reading →

Framework code complexity comparison

On his new blog on Medium, Taylor Otwell, creator of Laravel, published some statistics on the code complexity of various popular PHP frameworks. Draw your own conclusion. Last week as I was refactoring and cleaning Laravel for the 5.4 release, Graham Campbell showed me some code complexity statistics for the framework. I decided to compare […]

Continue reading →

Making overloaded functions readable

Sometimes you might allow a function to accept multiple data types. I don’t know for certain if it’s the correct term but for the remainder of this post I’m going to call such a function overloaded. In this post I’d like to show you a little trick to make overloaded functions more readable. Let’s first […]

Continue reading →

A collection of PHPStorm tips

Nikush Patel created an awesome little site where he shares PHPStorm tips. Every tip is demonstrated by an animated gif. I’m a big fan of PhpStorm and an equally big fan of keyboard shortcuts and optimised workflows, so I wanted to share all the best tips and tricks I know to help everyone else make […]

Continue reading →