PHP and Serializing…don’t try and store the result in a plain text file, there’s just a chance you may end up storing NUL so when you go to read a line, you’ll end up only reading part of it (the serialized object had a stack trace in it from an exception.)
Incidentally, don’t try and debug code that works – it’s always a good idea to read the code that is storing the data you think is wrong before trying to debug the output, I couldn’t work out why I wasn’t logging somethin only for certain exceptions, then eventually I checked the logging line and realised, for that particular exception I had decided to do a manual log entry rather than throw and catch an exception.
And now here’s a cat:
Courtesy of ICanHazCheezburger