Confronting our Demons

Confronting our own inner demons is the hardest battle we ever have to face, especially when they’re so deep-rooted after so many years: filling in the holes that each leaves behind with hope, because that’s all that I have at the moment. I’m feeling a little like Pandora’s Box.

Continue reading

Posted in Personal | Tagged | Leave a comment

A Reverse-Retrospective: Places that I’m looking forward to visiting in 2021

With all the closures and travel restrictions in place during last year, there are so many places that I wanted to visit, but wasn’t able to. So rather than a look back at last year (with so much trauma and negativity), I’m going to look forward (and positively) to where I’ll be able to go this year as lockdown eases, and travel becomes possible again. There are so many places in Europe and across the world that I want to go, but I’m going to limit myself to the Netherlands at the moment, places just a few hours drive or train journey from where I live.


Continue reading

Posted in Uncategorized | Tagged , | 1 Comment

Under the Radar? A Backwards-Compatible Break for SPLFixedArray in PHP 8

The official release date for PHP 8 is 26th November, just 9 days away, so we’re almost into the last week; and I’ve just discovered a change to SPLFixedArray that I wasn’t previously aware about. While not many developers use SPL Datastructures, and probably fewer still use SPLFixedArray, it is a big BC break; and it wasn’t something that I had seen documented as a PHP 8 change.

Continue reading

Posted in PHP | Tagged , , , , , | Leave a comment

An Attempt at Poetry

It’s been nearly two months since my last post, two months trying to pull myself out from the state that I’d got myself into. 2020 isn’t a forgiving year, and I’m hurting myself and others with the darkness that I’ve found myself facing.

So I’m trying to express some of my emotions in poetry (of a sort) in English, and also in Dutch.

Continue reading

Posted in Personal | Tagged , | Leave a comment

Fear and Self-Loathing in Amsterdam

 

I must not fear.
Fear is the mind-killer.
Fear is the little-death that brings total obliteration.
I will face my fear.
I will permit it to pass over me and through me.
And when it has gone past I will turn the inner eye to see its path.
Where the fear has gone there will be nothing.
Only I will remain.

– Bene Gesserit Litany Against Fear, Dune series of books, written by Frank Herbert

As an Englishman of a certain generation, I was brought up to believe that it was bad to show emotions, that I should keep everything bottled up inside… “stiff upper lip”, “it just isn’t the done thing”, “it’s a sign of weakness”, and all that. If you’re scared, then you should put on a brave face: if things are going badly, then still look cheerful and don’t let anybody know how unhappy you are.

Continue reading

Posted in Personal | Tagged , | 1 Comment

Citizen of Nowhere

Tonight at midnight (local time) I become a “citizen of nowhere”.

european-union-eu-flag-missing-star-brexit

Continue reading

Posted in Uncategorized | Leave a comment

Filtering and Mapping with SPL Iterators

Four or five years ago, the most popular talk that I gave at conferences was entitled “A Functional Guide to Cat Herding with PHP Generators” (the cats proved a very enjoyable talking point at every event where I gave it, because who doesn’t enjoy a technical talk featuring cats); and I even wrote a blog post here about that self-same topic. That presentation described how I was building up enormous volumes of GPX tracking data showing where my cats roamed each day. In order to analyse that data without using equally enormous amounts of memory, I read it directly from the GPX files, using Generators to process each trackpoint one at a time; and and took a map, filter, reduce approach to resolving the questions I wanted to answer about my cats movement habits. Because PHP’s standard array_map(), array_filter() and array_reduce() functions only work with arrays of data, which are expensive in terms of their memory usage, I wrote my own versions of those functions to work with Traversable objects (like Iterators and Generators) as well as with arrays. And the technical body of the talk was how I wrote and used my versions of these functions.

I chose to write the functions myself as a learning exercise, to better understand how they (and Traversables like Generators) worked; but for map and filter, I could just as easily have used the Iterators that already existed in the Standard PHP Library (SPL).

Continue reading

Posted in PHP | Tagged , , , , , | Leave a comment

Parallel Looping in PHP with SPL’s MultipleIterator

There was a time, back when I was working with PHP 5, when I found the Standard PHP Library (SPL) an extremely powerful and useful toolbox; and I particularly enjoyed working with SPL’s Iterators and Datastructures. Sadly, SPL was always a somewhat forgotten component of PHP, even when it was incorporated into core, probably due to the lack of documentation (although Pete Cowburn and the other PHP documentors did work hard to improve it over the years). With the arrival of PHP 7, SPL seems to have dropped even further into a backwater: generally we create our own exception classes, though we may sometimes use those in the SPL; we rely on Composer to handle autoloading, rather than using SPL directly to set up our autoloading manually; and Datastructures (one of my favourite SPL components) are better implemented in Rudi Theunissen’s ext-ds library.

But although much of the SPL is now outdated, or has been superseded by better language elements; some components are still useful. SPL’s Iterators are confusingly named, and there’s little in the documentation that explains when and how they can/should be used, but if you can learn to understand them, they are still powerful tools even with PHP 7; especially as they work with any Traversable (like Iterators and Generators, or the Collection objects provided by many frameworks), not simply with arrays.

Continue reading

Posted in PHP | Tagged , , , , | Leave a comment

Withdrawal from Speaking at PHPCE 2019

I’m always nervous when I speak at a conference or in front of a user group; but I also enjoy sharing my passion and excitement for things that I’ve learned, or new tools that I’ve discovered. That makes it particularly difficult for me to withdraw from a conference where I’ve already committed to speak, not giving just one talk, but two. But sometimes it is necessary to stand by my beliefs, despite the fact that it causes disruption to the conference organisers when they’ve already announced the schedule, and means that I can’t share my passion for coding with the attendees at that conference.

That’s the position that I found myself in barely a week ago.

Continue reading

Posted in PHP | Tagged , , , , | 27 Comments

A Year in Retrospect

At New Year, many people write a retrospective of the old year, and about their hopes and dreams for the new.

The roots for my own changes over the last year really lie earlier: 2017 was the year when a health scare saw me rattling around the PHPNW Conference spaced out on a cocktail of drugs as the doctors tried to figure out what was wrong with me. My memories of the Conference are very fragmented, and the medics never did figure out the problem: fortunately my body resolved the situation (whether assisted by the drugs or not); although I spent much of that last Christmas/New Year period in agony from the side effects of some of the medications that I’d been prescribed.
But mentally at the beginning of 2018 I was also in a really bad state.

Continue reading

Posted in Uncategorized | Tagged , | 2 Comments