Code from my talk at the 2014 php[world] conference.