Skip to content

Category: PHP


Today I was looking for a way to subscribe to file changes in a directory in MacOS, in order to trigger automatically running commands whenever files change.

Turns out Homebrew has “fswatch”, which tells you when things change, but little else.

Turns out Homebrew has “watchman”, which does all this, and on multiple trees, finds changes across restarts and automatically manages a set of commands for different file endings.

Also turns out that I know the author. Thanks, Wez!

Leave a Comment

PHP: Understanding unserialize()

The history of serialize() and unserialize() in PHP begins with Boris Erdmann and me, and we have to go 20 years back in time. This is the day of the prerelease versions of PHP 3, some time in 1998.

Boris and I were working on Code for a management system for employee education for German Telekom. The front side is a web shop that sells classes and courses, the back end is a complex structure that manages attendance, keeps track of a line manager approval hierarchy and provides alternative dates for overfull classes.

In order to manage authentication, shopping carts and other internal state, we needed something that allowed us to go from a stateless system to a stateful thing, securely. The result was PHPLIB, and especially the code in

That code contained a function serialize(), which created a stringified representation of a PHP variable and appended it to a string. There was no unserialize() necessary, because serialize() generated PHP code. eval() would unserialize().