Blog

Modifying Variables in PHP Closures

This one caught me out yesterday. If you use a variable in a PHP closure and try and modify it inside the closure, you will find that the variable outside the closure is not modified. You must pass the variable by reference for it to work. Turns out that when ‘importing’ variables to a closure’s…

2016 Year In Review

As has been my tradition for the last six years now, I like to spend a bit of time on the last day of the year to reflect, consider the year that has been and the year that is to come, and note down some of these reflections for posterity. What a year 2016 has…

Running PHPUnit Tests in Docker

Recently I came across the situation where I needed to run the PHPUnit tests for the project I was working on in PHP 5.6 as they were failing in Travis. The project was a Laravel project and so was running in a Homestead box using PHP 7. For development of other sites I use Laravel…

Backing Up Laravel Homestead Databases

Laravel Homestead is an awesome tool for building Laravel sites. However, sometimes it would be nice if when you did a vagrant destory you wouldn’t lose all of the information in your databases. Or in my case, if you database crashes and you can’t get it back up, it would be great if you had…

How and why I built Web Uptime

Back in May this year I launched a new side project called Web Uptime. Web Uptime provides multi-location website uptime monitoring for your sites. I’m not going to talk so much about what Web Uptime does here, you can see the marketing site to find out more, rather I’m going to talk about how and…

Becoming a Father

On the 23rd March 2016 at 10:31pm my life changed. I had spent months pre-empting what it would be like to become a father. What would the experience of labour be like? How would we handle looking after a child 24/7? How would I feel when I first saw my child? As anyone who is…