whateverthing.com

May 3, 2020

Arrow Functions are a new syntax for short anonymous functions introduced in PHP 7.4.

Anonymous functions, if you're not familiar with them, are special functions written inside other sections of your code that you can pass around kind of like variables.

Usually these functions are very short and purpose-built. They're not supposed to contain a huge amount of logic.

Where arrow functions stand out is that they allow you to write concise single-operation anonymous functions like you might use when doing sorting or map/reduce operations.

April 21, 2020

PHP 7 and 8 are huge leaps forward for the language. Gone are the days of hacking together an entire web application in a single file (although you can technically still do that, if you're feeling retro). Now there are so many fancy new language features that you might find yourself adrift in the sea of changes.

I'd like to introduce some of these new features one at a time, to give them a chance to catch your attention and capture your imagination.

Today's subject: the Null Coalesce operator, a little ditty from PHP 7.0 that looks like ??.

March 18, 2020

Way back in 2011, I created Beryllium\CacheBundle for Symfony 2. It got a bit of traction, but superior options soon appeared, and then PSR-6 landed and promised a whole new world of caching. PSRs, or "PHP Standard Recommendations", are a group of framework interoperability interfaces provided by the PHP Framework Interoperability Group (FIG).

I wasn't exactly a fan of PSR-6.

The PSR was well-engineered, but it seemed like overkill for my projects. And on top of that, I was no longer working on the project that had needed caching in the first place.