whateverthing.com

November 22, 2020

Have you heard of PHPSandbox yet? No? Well, I hadn't either, until @ramsey let me know about it on Twitter. It's like the next generation of 3v4l.org - it lets you run PHP code in a shareable online sandbox.

Some of its next-generation features include the ability to select which type of project (or "Notebook") you'll be writing, which can pre-fill a bunch of information for you. You can also select Composer packages to install as part of the notebook.

October 10, 2020

Many years ago, I wrote a joke library called Kaboom. Its purpose was to detect if error reporting was improperly configured in Development environments, and if so, go Kaboom! by throwing an exception.

Yesterday, I was writing some code for Sculpin (an open source static site generator that I contribute to) and I wanted to make sure that a particular bit of code that could contain path traversal vulnerabilities wouldn't be forgotten about when I wandered away to other priorities.

To accomplish that, I added a unix timestamp check of "today plus one day" hard-coded as magic numbers. That way, when I came back to the PR, it would stop working in a very obvious way, letting me know that the issue had not been solved.

Then, I tweeted about it. And some people were intrigued by it. They had concerns, of course, but the response inspired me to rewrite my Kaboom project and release it to Packagist.

Introducing Kaboom v1.0

May 16, 2020

PHP has had type hints and type declarations for several versions, but they haven't really been available in all contexts. Class-based type hints on method parameters arrived in PHP 5.x, and PHP 7.0 added Scalar type declarations. You can set a type on a method parameter, or specify a return type, but in PHP 7.4 we got something really fun: Now you can declare a type on a class property.